THPDFSoundParams Record
Caller-supplied sample rate, channel, bit depth, and encoding metadata 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 be greater than zero, typical values are 22050, 44100, and 48000 |
Channels | Channel count written as /C (1 mono, 2 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; values of zero or less fall 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 the helper never hard-codes the v2.16-era 22050 / 16 / 2 / Signed defaults, which mis-play any source recorded at a different rate
- A non-positive
SampleRateraises an exception naming the calling method, so always set it from the actual audio format