Set wave output to disk file. (ANSI version)
function SetWaveOutFile(const FileName: AnsiString; Format: TStreamFormat; fOutputToSoundcard: Boolean): Boolean; overload;
Parameters |
Description |
const FileName: AnsiString |
Points to string that specifies the name of the file. |
Format: TStreamFormat |
Specify encoding format. Library will encode PCM samples into this format using internal encoder. |
fOutputToSoundcard: Boolean |
Specify if you need to send PCM samples to soundcard output. If this value is true, library will play samples to soundcard output. |
Return Values |
Description |
1 |
All OK. |
0 |
Error. To get error message read here. |
By default, library will output decoded or recorded samples to soundcard. But you can intercept these PCM samples, encode samples to specified format and save encoded stream into disk file.
Library decodes streams(mp3, ogg, ...) into raw PCM samples and sends these samples to soundcard. You can use callback mechanism to intercept these samples.
SetWaveOutFile function is using the same approach. It intercepts raw PCM samples. Then sends these raw samples to specified encoder. Encoder produces output stream. And at the end, encoded stream is saved to specified disk file.
Note: |
Every opening function will cancel disk output and set output to soundcard. Therefore, you must set wave output to disk file after each opening function. |
Format |
File extension |
Description |
mp3 |
MPEG-1, MPEG-2, MPEG 2.5 - Layer III. 128 kbps, JOINT STEREO, CBR. Not supported in PF version. | |
ogg |
VORBIS OGG, quality 4.0 (128 kbps) - STEREO. | |
flac, oga |
Native FLAC and OGG flac, compression level 5, stereo. | |
aac |
AAC ADTS stream. MPEG2, LOW, 34 kbps, quality 100, stereo. Not supported in PF version. | |
wav |
PCM WAVE with RIFF header, uncompressed, 16 bit per sample, stereo. | |
any file |
Raw PCM audio format, uncomressed, 16 bit per sample, stereo, little-endian. |
Copyright (c) 2010. Zoran Cindori - All rights reserved.
Web: http://libzplay.sourceforge.net/ Email: zcindori@inet.hr |