Final Platform Layer 0.9.8-beta
|
This category contains functions for start/stop playing audio and retrieving/changing some audio-related settings. More...
Typedefs | |
typedef enum fplAudioResultType | fplAudioResultType |
An enumeration of audio results. | |
Functions | |
fpl_common_api void | fplConvertAudioTargetFormatToDeviceFormat (const fplAudioTargetFormat *inFormat, fplAudioDeviceFormat *outFormat) |
Converts a fplAudioTargetFormat into a fplAudioDeviceFormat structure. | |
fpl_common_api const char * | fplGetAudioBackendName (fplAudioBackendType backendType) |
Gets the string that represents the given audio backend type. | |
fpl_common_api fplAudioBackendType | fplGetAudioBackendType () |
Gets the current audio backend type. | |
fpl_common_api uint32_t | fplGetAudioBufferSizeInBytes (const fplAudioFormatType format, const uint32_t channelCount, const uint32_t frameCount) |
Computes the total number of bytes for the buffer and the given parameters. | |
fpl_common_api uint32_t | fplGetAudioBufferSizeInFrames (uint32_t sampleRate, uint32_t bufferSizeInMilliSeconds) |
Computes the total number of frames for given sample rate and buffer size. | |
fpl_common_api uint32_t | fplGetAudioBufferSizeInMilliseconds (uint32_t sampleRate, uint32_t frameCount) |
Computes the duration in milliseconds for the given sample rate and frame count. | |
fpl_common_api uint32_t | fplGetAudioDevices (fplAudioDeviceInfo *devices, uint32_t maxDeviceCount) |
Retrieves all playback audio devices. | |
fpl_common_api const char * | fplGetAudioFormatName (const fplAudioFormatType format) |
Gets the string that represents the given audio format type. | |
fpl_common_api uint32_t | fplGetAudioFrameSizeInBytes (const fplAudioFormatType format, const uint32_t channelCount) |
Computes the number of bytes required for one interleaved audio frame - containing all the channels. | |
fpl_common_api bool | fplGetAudioHardwareFormat (fplAudioDeviceFormat *outFormat) |
Retrieves the native format for the current audio device. | |
fpl_common_api uint32_t | fplGetAudioSampleSizeInBytes (const fplAudioFormatType format) |
Computes the number of bytes required to write one sample with one channel. | |
fpl_common_api fplAudioResultType | fplPlayAudio () |
Start playing asynchronous audio. | |
fpl_common_api bool | fplSetAudioClientReadCallback (fpl_audio_client_read_callback *newCallback, void *userData) |
Overwrites the audio client read callback. | |
fpl_common_api fplAudioResultType | fplStopAudio () |
Stop playing asynchronous audio. | |
This category contains functions for start/stop playing audio and retrieving/changing some audio-related settings.
enum fplAudioResultType |
An enumeration of audio results.
Enumerator | |
---|---|
fplAudioResultType_None | No result. |
fplAudioResultType_Success | Success. |
fplAudioResultType_DeviceNotInitialized | The audio device is not initialized. |
fplAudioResultType_DeviceAlreadyStopped | The audio device is already stopped. |
fplAudioResultType_DeviceAlreadyStarted | The audio device is already started. |
fplAudioResultType_DeviceBusy | The audio device is busy/waiting. |
fplAudioResultType_NoDeviceFound | No audio device is found. |
fplAudioResultType_ApiFailed | Failed to load the audio api. |
fplAudioResultType_PlatformNotInitialized | The platform is not initialized. |
fplAudioResultType_BackendAlreadyInitialized | The audio backend is already initialized. |
fplAudioResultType_UnsetAudioFormat | The fplAudioFormatType is not set. |
fplAudioResultType_UnsetAudioChannels | The number of audio channels is not set. |
fplAudioResultType_UnsetAudioSampleRate | The sample rate is not set. |
fplAudioResultType_UnsetAudioBufferSize | The audio buffer size is not set. |
fplAudioResultType_Failed | Unknown error. |
fplAudioResultType_First | First fplAudioResultType. |
fplAudioResultType_Last | Last fplAudioResultType. |
Definition at line 6773 of file final_platform_layer.h.
fpl_common_api void fplConvertAudioTargetFormatToDeviceFormat | ( | const fplAudioTargetFormat * | inFormat, |
fplAudioDeviceFormat * | outFormat | ||
) |
Converts a fplAudioTargetFormat into a fplAudioDeviceFormat structure.
inFormat | The input format |
outFormat | The output format |
fpl_common_api const char * fplGetAudioBackendName | ( | fplAudioBackendType | backendType | ) |
Gets the string that represents the given audio backend type.
backendType | The audio backend type fplAudioBackendType |
fpl_common_api fplAudioBackendType fplGetAudioBackendType | ( | ) |
Gets the current audio backend type.
fpl_common_api uint32_t fplGetAudioBufferSizeInBytes | ( | const fplAudioFormatType | format, |
const uint32_t | channelCount, | ||
const uint32_t | frameCount | ||
) |
Computes the total number of bytes for the buffer and the given parameters.
format | The audio format |
channelCount | The number of channels |
frameCount | The number of frames |
fpl_common_api uint32_t fplGetAudioBufferSizeInFrames | ( | uint32_t | sampleRate, |
uint32_t | bufferSizeInMilliSeconds | ||
) |
Computes the total number of frames for given sample rate and buffer size.
sampleRate | The sample rate in Hz |
bufferSizeInMilliSeconds | The buffer size in milliseconds |
fpl_common_api uint32_t fplGetAudioBufferSizeInMilliseconds | ( | uint32_t | sampleRate, |
uint32_t | frameCount | ||
) |
Computes the duration in milliseconds for the given sample rate and frame count.
sampleRate | The sample rate in Hz |
frameCount | The number of frames |
fpl_common_api uint32_t fplGetAudioDevices | ( | fplAudioDeviceInfo * | devices, |
uint32_t | maxDeviceCount | ||
) |
Retrieves all playback audio devices.
devices | A array of audio device info fplAudioDeviceInfo |
maxDeviceCount | The total number of devices available in the devices array. |
fpl_common_api const char * fplGetAudioFormatName | ( | const fplAudioFormatType | format | ) |
Gets the string that represents the given audio format type.
format | The audio format type fplAudioFormatType |
fpl_common_api uint32_t fplGetAudioFrameSizeInBytes | ( | const fplAudioFormatType | format, |
const uint32_t | channelCount | ||
) |
Computes the number of bytes required for one interleaved audio frame - containing all the channels.
format | The audio format |
channelCount | The number of channels |
fpl_common_api bool fplGetAudioHardwareFormat | ( | fplAudioDeviceFormat * | outFormat | ) |
Retrieves the native format for the current audio device.
outFormat | The pointer to the fplAudioDeviceFormat structure |
fpl_common_api uint32_t fplGetAudioSampleSizeInBytes | ( | const fplAudioFormatType | format | ) |
Computes the number of bytes required to write one sample with one channel.
format | The audio format type fplAudioFormatType |
fpl_common_api fplAudioResultType fplPlayAudio | ( | ) |
Start playing asynchronous audio.
fpl_common_api bool fplSetAudioClientReadCallback | ( | fpl_audio_client_read_callback * | newCallback, |
void * | userData | ||
) |
Overwrites the audio client read callback.
newCallback | The pointer to the fpl_audio_client_read_callback callback |
userData | The pointer to the client/user data |
fpl_common_api fplAudioResultType fplStopAudio | ( | ) |
Stop playing asynchronous audio.