Difference between revisions of "Decode File API"
m (Protected "Decode File API" [edit=autoconfirmed:move=autoconfirmed])
Revision as of 14:58, 25 September 2008
Decode File API
Interface name: api_decodefile
Related interfaces: ifc_audiostream
Include file: Agave/DecodeFile/api_decodefile.h
Related files: Agave/DecodeFile/ifc_audiostream.h
GUID name: decodeFileGUID
api_decodefile allows you to decode audio files to PCM.
Uses by Winamp:
It is used by the CD Burner to decode files to Red Book audio prior to burning.
It is used by the Auto Tagger to decode files prior to feed to the analysis engine.
It is used by the IPC_CONVERTFILE API to decode files prior to feeding the encoder.
How to use:
Open an audio stream (ifc_audiostream) by calling OpenAudioBackground(). The passed AudioParameters struct may be filled with requested values; some formats are able to return multiple PCM data types and this can be used to request a particular format. Winamp will also apply resampling, bit decimation and downmixing, although it is not guaranteed to work in all situations. You need to verify the AudioParameters struct after opening the audio - it may have been opened with different parameters than what you wanted or expected!
The returned ifc_audiostream is then read sequentially. Call ReadAudio() continuously until 0 is returned or an error is reported. The audio stream is closed by calling api_decodefile's CloseAudio() method.