aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-12-28 10:35:56 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-12-28 10:35:56 +0000
commitf55efca1666a399d986b0f08fec218baeec02710 (patch)
tree71336ba9b0141a5dc2f12eb5408ead1d890acc5d /src
parenta050a0646c15a1dbada290bba7d874c9438d18ec (diff)
downloadusdx-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
Diffstat (limited to 'src')
-rw-r--r--src/base/UMusic.pas9
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();