diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-12-28 10:35:56 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-12-28 10:35:56 +0000 |
commit | f55efca1666a399d986b0f08fec218baeec02710 (patch) | |
tree | 71336ba9b0141a5dc2f12eb5408ead1d890acc5d | |
parent | a050a0646c15a1dbada290bba7d874c9438d18ec (diff) | |
download | usdx-f55efca1666a399d986b0f08fec218baeec02710.tar.gz usdx-f55efca1666a399d986b0f08fec218baeec02710.tar.xz usdx-f55efca1666a399d986b0f08fec218baeec02710.zip |
add GetSampleSize()
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2778 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r-- | src/base/UMusic.pas | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/base/UMusic.pas b/src/base/UMusic.pas index c775fd51..be6b8baf 100644 --- a/src/base/UMusic.pas +++ b/src/base/UMusic.pas @@ -178,6 +178,7 @@ type procedure SetFormat(Format: TAudioSampleFormat); procedure UpdateFrameSize(); function GetBytesPerSec(): double; + function GetSampleSize(): integer; public constructor Create(Channels: byte; SampleRate: double; Format: TAudioSampleFormat); function Copy(): TAudioFormatInfo; @@ -193,6 +194,7 @@ type property Channels: byte read fChannels write SetChannels; property Format: TAudioSampleFormat read fFormat write SetFormat; property FrameSize: integer read fFrameSize; + property SampleSize: integer read GetSampleSize; property BytesPerSec: double read GetBytesPerSec; end; @@ -650,7 +652,12 @@ end; function TAudioFormatInfo.GetBytesPerSec(): double; begin - Result := FrameSize * SampleRate; + Result := FrameSize * SampleRate; +end; + +function TAudioFormatInfo.GetSampleSize(): integer; +begin + Result := AudioSampleSize[fFormat]; end; procedure TAudioFormatInfo.UpdateFrameSize(); |