THPDFSoundParams Record
Sample rate, channel, bit depth and encoding metadata supplied by the caller for PDF Sound objects
Declaration
THPDFSoundParams= record
SampleRate: Single; // /R Hz; typical 22050 / 44100 / 48000
Channels: Integer; // /C 1=mono, 2=stereo; default 1
BitsPerSample: Integer; // /B 1/2/4/8/16/24/32; default 8
Encoding: AnsiString; // /E 'Raw' | 'Signed' | 'muLaw' | 'ALaw'
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
SampleRate | Playback rate in Hertz written as /R; must exceed zero, with 22050, 44100 and 48000 the usual values |
Channels | Channel count written as /C, 1 for mono and 2 for stereo; values of zero or less fall back to 1 |
BitsPerSample | Sample width written as /B, one of 1, 2, 4, 8, 16, 24, 32; zero or less falls back to 8 |
Encoding | Sample encoding written as /E: Raw, Signed, muLaw or ALaw; an empty string falls back to Raw |
Usage notes
- Pass it to
THPDFActionBuilder.Soundor the sound action button builders; the values become the /R, /C, /B and /E entries of the Sound object dictionary - These fields exist so that the helper never hard-codes the v2.16-era 22050 / 16 / 2 / Signed defaults, which mis-play any source recorded at another rate
- A non-positive
SampleRateraises an exception that names the calling method, so always take the value from the actual audio format