From f55efca1666a399d986b0f08fec218baeec02710 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 28 Dec 2010 10:35:56 +0000 Subject: add GetSampleSize() git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2778 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UMusic.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/base') 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(); -- cgit v1.2.3