JubeatPlus 3.9.11
Loading...
Searching...
No Matches
OpenALSupport.h File Reference

The audio-file decoder that feeds raw PCM samples to OpenAL. More...

import <Foundation/Foundation.h>
import <OpenAL/al.h>
Include dependency graph for OpenALSupport.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.

Detailed Description

The audio-file decoder that feeds raw PCM samples to OpenAL.

Function Documentation

◆ MyGetOpenALAudioData()

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.

Parameters
inFileURLThe audio file to decode.
outDataSizeReceives the sample data's length in bytes.
outDataFormatReceives the OpenAL format enumerator (AL_FORMAT_MONO16 or AL_FORMAT_STEREO16), chosen by channel count.
outSampleRateReceives the sample rate, truncated from the file's.
Returns
The sample data, which the caller owns and must free, or nullptr on any failure.
Ghidra address:
0x153cd4
Ghidra address:
0x153cd4