|
JubeatPlus 3.9.11
|
The audio-file decoder that feeds raw PCM samples to OpenAL. More...
import <Foundation/Foundation.h>import <OpenAL/al.h>
Go to the source code of this file.
Functions | |
| void * | MyGetOpenALAudioData (NSURL *inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei *outSampleRate) |
| Decodes an audio file into raw 16-bit linear PCM samples for OpenAL. | |
The audio-file decoder that feeds raw PCM samples to OpenAL.
| void * MyGetOpenALAudioData | ( | NSURL * | inFileURL, |
| ALsizei * | outDataSize, | ||
| ALenum * | outDataFormat, | ||
| ALsizei * | outSampleRate ) |
Decodes an audio file into raw 16-bit linear PCM samples for OpenAL.
Opens inFileURL with the ExtAudioFile API, converts the file to an interleaved signed 16-bit linear-PCM client format, allocates the sample buffer with malloc, reads every frame into it, and returns the buffer. The caller takes ownership of the returned buffer and must free it.
On any failure the routine prints a diagnostic to standard output and returns nullptr. More than two channels is rejected as unsupported.
| inFileURL | The audio file to decode. |
| outDataSize | Receives the sample data's length in bytes. |
| outDataFormat | Receives the OpenAL format enumerator (AL_FORMAT_MONO16 or AL_FORMAT_STEREO16), chosen by channel count. |
| outSampleRate | Receives the sample rate, truncated from the file's. |
nullptr on any failure.