libZPlay documentation (Win32)
IndexReferenceHome
PreviousUpNext
libZPlayCpp::zplay_SetWaveOutFile Function

Set wave output to disk file. (ANSI version)

C++
__stdcall W_DECLSPEC int zplay_SetWaveOutFile(ZPLAY_HANDLE handle, const char * sFileName, TStreamFormat nFormat, unsigned int fOutputToSoundcard);
Parameters 
Description 
ZPLAY_HANDLE handle 
ZPLAY handle. Get this handle with zplay_CreateZPlay
const char * sFileName 
Points to a ANSI null-terminated string that specifies the name of the file. 
TStreamFormat nFormat 
Specify encoding format. Library will encode PCM samples into this format using internal encoder. 
unsigned int fOutputToSoundcard 
Specify if you need to send PCM samples to soundcard output. If this value is 1, library will play samples to soundcard output. 
Return Values 
Description 
All OK. 
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.
 

 

 

Supported encoders
Format 
File extension 
Description 
MP3 
mp3 
MPEG-1, MPEG-2, MPEG 2.5 - Layer III. 128 kbps, JOINT STEREO, CBR. Not supported in PF version. 
OGG 
ogg 
VORBIS OGG, quality 4.0 (128 kbps) - STEREO. 
FLAC 
flac, oga 
Native FLAC and OGG flac, compression level 5, stereo. 
AAC 
aac 
AAC ADTS stream. MPEG2, LOW, 34 kbps, quality 100, stereo. Not supported in PF version. 
WAVE 
wav 
PCM WAVE with RIFF header, uncompressed, 16 bit per sample, stereo. 
PCM 
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