diff --git a/examples/custom_decoder.c b/examples/custom_decoder.c index 2af9414f..aef2fab9 100644 --- a/examples/custom_decoder.c +++ b/examples/custom_decoder.c @@ -35,140 +35,6 @@ MINIAUDIO_IMPLEMENTATION system. This will change from version 0.12. #include -static ma_result ma_decoding_backend_init__libvorbis(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libvorbis* pVorbis; - - (void)pUserData; - - pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libvorbis_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pVorbis); - if (result != MA_SUCCESS) { - ma_free(pVorbis, pAllocationCallbacks); - return result; - } - - *ppBackend = pVorbis; - - return MA_SUCCESS; -} - -static ma_result ma_decoding_backend_init_file__libvorbis(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libvorbis* pVorbis; - - (void)pUserData; - - pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libvorbis_init_file(pFilePath, pConfig, pAllocationCallbacks, pVorbis); - if (result != MA_SUCCESS) { - ma_free(pVorbis, pAllocationCallbacks); - return result; - } - - *ppBackend = pVorbis; - - return MA_SUCCESS; -} - -static void ma_decoding_backend_uninit__libvorbis(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) -{ - ma_libvorbis* pVorbis = (ma_libvorbis*)pBackend; - - (void)pUserData; - - ma_libvorbis_uninit(pVorbis, pAllocationCallbacks); - ma_free(pVorbis, pAllocationCallbacks); -} - -static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libvorbis = -{ - ma_decoding_backend_init__libvorbis, - ma_decoding_backend_init_file__libvorbis, - NULL, /* onInitFileW() */ - NULL, /* onInitMemory() */ - ma_decoding_backend_uninit__libvorbis -}; - - - -static ma_result ma_decoding_backend_init__libopus(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libopus* pOpus; - - (void)pUserData; - - pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); - if (pOpus == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libopus_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pOpus); - if (result != MA_SUCCESS) { - ma_free(pOpus, pAllocationCallbacks); - return result; - } - - *ppBackend = pOpus; - - return MA_SUCCESS; -} - -static ma_result ma_decoding_backend_init_file__libopus(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libopus* pOpus; - - (void)pUserData; - - pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); - if (pOpus == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libopus_init_file(pFilePath, pConfig, pAllocationCallbacks, pOpus); - if (result != MA_SUCCESS) { - ma_free(pOpus, pAllocationCallbacks); - return result; - } - - *ppBackend = pOpus; - - return MA_SUCCESS; -} - -static void ma_decoding_backend_uninit__libopus(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) -{ - ma_libopus* pOpus = (ma_libopus*)pBackend; - - (void)pUserData; - - ma_libopus_uninit(pOpus, pAllocationCallbacks); - ma_free(pOpus, pAllocationCallbacks); -} - -static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libopus = -{ - ma_decoding_backend_init__libopus, - ma_decoding_backend_init_file__libopus, - NULL, /* onInitFileW() */ - NULL, /* onInitMemory() */ - ma_decoding_backend_uninit__libopus -}; - - - void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount) { ma_data_source* pDataSource = (ma_data_source*)pDevice->pUserData; diff --git a/examples/custom_decoder_engine.c b/examples/custom_decoder_engine.c index e0b5949c..a10b8cd7 100644 --- a/examples/custom_decoder_engine.c +++ b/examples/custom_decoder_engine.c @@ -16,140 +16,6 @@ MINIAUDIO_IMPLEMENTATION system. This will change from version 0.12. #include -static ma_result ma_decoding_backend_init__libvorbis(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libvorbis* pVorbis; - - (void)pUserData; - - pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libvorbis_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pVorbis); - if (result != MA_SUCCESS) { - ma_free(pVorbis, pAllocationCallbacks); - return result; - } - - *ppBackend = pVorbis; - - return MA_SUCCESS; -} - -static ma_result ma_decoding_backend_init_file__libvorbis(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libvorbis* pVorbis; - - (void)pUserData; - - pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); - if (pVorbis == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libvorbis_init_file(pFilePath, pConfig, pAllocationCallbacks, pVorbis); - if (result != MA_SUCCESS) { - ma_free(pVorbis, pAllocationCallbacks); - return result; - } - - *ppBackend = pVorbis; - - return MA_SUCCESS; -} - -static void ma_decoding_backend_uninit__libvorbis(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) -{ - ma_libvorbis* pVorbis = (ma_libvorbis*)pBackend; - - (void)pUserData; - - ma_libvorbis_uninit(pVorbis, pAllocationCallbacks); - ma_free(pVorbis, pAllocationCallbacks); -} - -static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libvorbis = -{ - ma_decoding_backend_init__libvorbis, - ma_decoding_backend_init_file__libvorbis, - NULL, /* onInitFileW() */ - NULL, /* onInitMemory() */ - ma_decoding_backend_uninit__libvorbis -}; - - - -static ma_result ma_decoding_backend_init__libopus(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libopus* pOpus; - - (void)pUserData; - - pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); - if (pOpus == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libopus_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pOpus); - if (result != MA_SUCCESS) { - ma_free(pOpus, pAllocationCallbacks); - return result; - } - - *ppBackend = pOpus; - - return MA_SUCCESS; -} - -static ma_result ma_decoding_backend_init_file__libopus(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) -{ - ma_result result; - ma_libopus* pOpus; - - (void)pUserData; - - pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); - if (pOpus == NULL) { - return MA_OUT_OF_MEMORY; - } - - result = ma_libopus_init_file(pFilePath, pConfig, pAllocationCallbacks, pOpus); - if (result != MA_SUCCESS) { - ma_free(pOpus, pAllocationCallbacks); - return result; - } - - *ppBackend = pOpus; - - return MA_SUCCESS; -} - -static void ma_decoding_backend_uninit__libopus(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) -{ - ma_libopus* pOpus = (ma_libopus*)pBackend; - - (void)pUserData; - - ma_libopus_uninit(pOpus, pAllocationCallbacks); - ma_free(pOpus, pAllocationCallbacks); -} - -static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libopus = -{ - ma_decoding_backend_init__libopus, - ma_decoding_backend_init_file__libopus, - NULL, /* onInitFileW() */ - NULL, /* onInitMemory() */ - ma_decoding_backend_uninit__libopus -}; - - - int main(int argc, char** argv) { ma_result result; @@ -159,13 +25,22 @@ int main(int argc, char** argv) ma_engine engine; /* - Add your custom backend vtables here. The order in the array defines the order of priority. The - vtables will be passed in to the resource manager config. + Add your custom backend vtables here. The order in the array defines the order of priority, with the + first being the highest priority. The vtables are be passed in via the decoder config. If you want to + support stock backends in addition to custom backends, you must add the stock backend vtables here as + well. You should list the backends in your preferred order of priority. + + The list below shows how you would set up your array to prioritize the custom decoders over the stock + decoders. If you want to prioritize the stock decoders over the custom decoders, you would simply + change the order. */ - ma_decoding_backend_vtable* pCustomBackendVTables[] = + const ma_decoding_backend_vtable* pBackendVTables[] = { - &g_ma_decoding_backend_vtable_libvorbis, - &g_ma_decoding_backend_vtable_libopus + ma_decoding_backend_libvorbis, + ma_decoding_backend_libopus, + ma_decoding_backend_wav, + ma_decoding_backend_flac, + ma_decoding_backend_mp3 }; @@ -177,9 +52,8 @@ int main(int argc, char** argv) /* Using custom decoding backends requires a resource manager. */ resourceManagerConfig = ma_resource_manager_config_init(); - resourceManagerConfig.ppCustomDecodingBackendVTables = pCustomBackendVTables; - resourceManagerConfig.customDecodingBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]); - resourceManagerConfig.pCustomDecodingBackendUserData = NULL; /* <-- This will be passed in to the pUserData parameter of each function in the decoding backend vtables. */ + resourceManagerConfig.ppDecodingBackendVTables = pBackendVTables; + resourceManagerConfig.decodingBackendCount = sizeof(pBackendVTables) / sizeof(pBackendVTables[0]); result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager); if (result != MA_SUCCESS) { diff --git a/examples/duplex_effect.c b/examples/duplex_effect.c index 6a07fd25..86c57bcc 100644 --- a/examples/duplex_effect.c +++ b/examples/duplex_effect.c @@ -116,7 +116,7 @@ int main(int argc, char** argv) /* Excite/modulator. Attached to input bus 1 of the vocoder node. */ - result = ma_audio_buffer_ref_init(device.capture.format, device.capture.channels, NULL, 0, &g_exciteData); + result = ma_audio_buffer_ref_init(device.capture.format, device.capture.channels, device.sampleRate, NULL, 0, &g_exciteData); if (result != MA_SUCCESS) { printf("Failed to initialize audio buffer for source."); goto done2; diff --git a/examples/engine_steamaudio.c b/examples/engine_steamaudio.c index 3e6469be..f8eab995 100644 --- a/examples/engine_steamaudio.c +++ b/examples/engine_steamaudio.c @@ -347,7 +347,7 @@ int main(int argc, char** argv) { ma_sound_config soundConfig; - soundConfig = ma_sound_config_init(); + soundConfig = ma_sound_config_init(&g_engine); soundConfig.pFilePath = argv[1]; soundConfig.flags = MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT; /* We'll attach this to the graph later. */ diff --git a/examples/hilo_interop.c b/examples/hilo_interop.c index 4a82f89d..620e238d 100644 --- a/examples/hilo_interop.c +++ b/examples/hilo_interop.c @@ -121,7 +121,7 @@ int main(int argc, char** argv) ring buffer. The capture side will be writing data into the ring buffer, whereas the sound will be reading from it. */ - result = ma_sound_init_from_data_source(&engine, &rb, 0, NULL, &sound); + result = ma_sound_init_from_data_source(&engine, &rb, 0, NULL, NULL, &sound); if (result != MA_SUCCESS) { printf("Failed to initialize the sound."); return -1; diff --git a/examples/resource_manager_advanced.c b/examples/resource_manager_advanced.c index 25b37e78..43b0ba65 100644 --- a/examples/resource_manager_advanced.c +++ b/examples/resource_manager_advanced.c @@ -156,7 +156,7 @@ static ma_thread_result MA_THREADCALL custom_job_thread(void* pUserData) for (;;) { ma_result result; - ma_resource_manager_job job; + ma_job job; /* Retrieve a job from the queue first. This defines what it is you're about to do. By default this will be diff --git a/examples/simple_playback_sine.c b/examples/simple_playback_sine.c index d053f5a0..8513dc11 100644 --- a/examples/simple_playback_sine.c +++ b/examples/simple_playback_sine.c @@ -57,8 +57,6 @@ int main(int argc, char** argv) return -4; } - printf("Device Name: %s\n", device.playback.name); - sineWaveConfig = ma_waveform_config_init(device.playback.format, device.playback.channels, device.sampleRate, ma_waveform_type_sine, 0.2, 220); ma_waveform_init(&sineWaveConfig, &sineWave); diff --git a/extras/decoders/libopus/miniaudio_libopus.c b/extras/decoders/libopus/miniaudio_libopus.c index b3403bd7..39df7ef0 100644 --- a/extras/decoders/libopus/miniaudio_libopus.c +++ b/extras/decoders/libopus/miniaudio_libopus.c @@ -455,4 +455,95 @@ MA_API ma_result ma_libopus_get_length_in_pcm_frames(ma_libopus* pOpus, ma_uint6 #endif } + +/* +The code below defines the vtable that you'll plug into your `ma_decoder_config` object. +*/ +static ma_result ma_decoding_backend_init__libopus(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) +{ + ma_result result; + ma_libopus* pOpus; + + (void)pUserData; + + pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); + if (pOpus == NULL) { + return MA_OUT_OF_MEMORY; + } + + result = ma_libopus_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pOpus); + if (result != MA_SUCCESS) { + ma_free(pOpus, pAllocationCallbacks); + return result; + } + + *ppBackend = pOpus; + + return MA_SUCCESS; +} + +static ma_result ma_decoding_backend_init_file__libopus(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) +{ + ma_result result; + ma_libopus* pOpus; + + (void)pUserData; + + pOpus = (ma_libopus*)ma_malloc(sizeof(*pOpus), pAllocationCallbacks); + if (pOpus == NULL) { + return MA_OUT_OF_MEMORY; + } + + result = ma_libopus_init_file(pFilePath, pConfig, pAllocationCallbacks, pOpus); + if (result != MA_SUCCESS) { + ma_free(pOpus, pAllocationCallbacks); + return result; + } + + *ppBackend = pOpus; + + return MA_SUCCESS; +} + +static void ma_decoding_backend_uninit__libopus(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) +{ + ma_libopus* pOpus = (ma_libopus*)pBackend; + + (void)pUserData; + + ma_libopus_uninit(pOpus, pAllocationCallbacks); + ma_free(pOpus, pAllocationCallbacks); +} + +static ma_encoding_format ma_decoding_backend_get_encoding_format__libopus(void* pUserData, ma_data_source* pBackend) +{ + (void)pUserData; + (void)pBackend; + + /* + When pBackend is null, return ma_encoding_format_unknown if the backend supports multiple + formats. An example might be an FFmpeg backend. If the backend only supports a single format, + like this one, return the format directly (if it's not recognized by miniaudio, return + ma_encoding_format_unknown). + + When pBackend is non-null, return the encoded format of the data source. If the format is not + recognized by miniaudio, return ma_encoding_format_unknown. + + Since this backend only operates on Opus streams, we can just return ma_encoding_format_opus + in all cases. + */ + return ma_encoding_format_opus; +} + +static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libopus = +{ + ma_decoding_backend_init__libopus, + ma_decoding_backend_init_file__libopus, + NULL, /* onInitFileW() */ + NULL, /* onInitMemory() */ + ma_decoding_backend_uninit__libopus, + ma_decoding_backend_get_encoding_format__libopus +}; +const ma_decoding_backend_vtable* ma_decoding_backend_libopus = &g_ma_decoding_backend_vtable_libopus; + #endif /* miniaudio_libopus_c */ diff --git a/extras/decoders/libopus/miniaudio_libopus.h b/extras/decoders/libopus/miniaudio_libopus.h index 66e9505a..f8d005c5 100644 --- a/extras/decoders/libopus/miniaudio_libopus.h +++ b/extras/decoders/libopus/miniaudio_libopus.h @@ -33,6 +33,9 @@ MA_API ma_result ma_libopus_get_data_format(ma_libopus* pOpus, ma_format* pForma MA_API ma_result ma_libopus_get_cursor_in_pcm_frames(ma_libopus* pOpus, ma_uint64* pCursor); MA_API ma_result ma_libopus_get_length_in_pcm_frames(ma_libopus* pOpus, ma_uint64* pLength); +/* Decoding backend vtable. This is what you'll plug into ma_decoder_config.pBackendVTables. No user data required. */ +extern const ma_decoding_backend_vtable* ma_decoding_backend_libopus; + #ifdef __cplusplus } #endif diff --git a/extras/decoders/libvorbis/miniaudio_libvorbis.c b/extras/decoders/libvorbis/miniaudio_libvorbis.c index 1ce7e7b5..75a68a3d 100644 --- a/extras/decoders/libvorbis/miniaudio_libvorbis.c +++ b/extras/decoders/libvorbis/miniaudio_libvorbis.c @@ -485,4 +485,95 @@ MA_API ma_result ma_libvorbis_get_length_in_pcm_frames(ma_libvorbis* pVorbis, ma #endif } + +/* +The code below defines the vtable that you'll plug into your `ma_decoder_config` object. +*/ +static ma_result ma_decoding_backend_init__libvorbis(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) +{ + ma_result result; + ma_libvorbis* pVorbis; + + (void)pUserData; + + pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); + if (pVorbis == NULL) { + return MA_OUT_OF_MEMORY; + } + + result = ma_libvorbis_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pVorbis); + if (result != MA_SUCCESS) { + ma_free(pVorbis, pAllocationCallbacks); + return result; + } + + *ppBackend = pVorbis; + + return MA_SUCCESS; +} + +static ma_result ma_decoding_backend_init_file__libvorbis(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend) +{ + ma_result result; + ma_libvorbis* pVorbis; + + (void)pUserData; + + pVorbis = (ma_libvorbis*)ma_malloc(sizeof(*pVorbis), pAllocationCallbacks); + if (pVorbis == NULL) { + return MA_OUT_OF_MEMORY; + } + + result = ma_libvorbis_init_file(pFilePath, pConfig, pAllocationCallbacks, pVorbis); + if (result != MA_SUCCESS) { + ma_free(pVorbis, pAllocationCallbacks); + return result; + } + + *ppBackend = pVorbis; + + return MA_SUCCESS; +} + +static void ma_decoding_backend_uninit__libvorbis(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks) +{ + ma_libvorbis* pVorbis = (ma_libvorbis*)pBackend; + + (void)pUserData; + + ma_libvorbis_uninit(pVorbis, pAllocationCallbacks); + ma_free(pVorbis, pAllocationCallbacks); +} + +static ma_encoding_format ma_decoding_backend_get_encoding_format__libvorbis(void* pUserData, ma_data_source* pBackend) +{ + (void)pUserData; + (void)pBackend; + + /* + When pBackend is null, return ma_encoding_format_unknown if the backend supports multiple + formats. An example might be an FFmpeg backend. If the backend only supports a single format, + like this one, return the format directly (if it's not recognized by miniaudio, return + ma_encoding_format_unknown). + + When pBackend is non-null, return the encoded format of the data source. If the format is not + recognized by miniaudio, return ma_encoding_format_unknown. + + Since this backend only operates on Vorbis streams, we can just return ma_encoding_format_vorbis + in all cases. + */ + return ma_encoding_format_vorbis; +} + +static ma_decoding_backend_vtable g_ma_decoding_backend_vtable_libvorbis = +{ + ma_decoding_backend_init__libvorbis, + ma_decoding_backend_init_file__libvorbis, + NULL, /* onInitFileW() */ + NULL, /* onInitMemory() */ + ma_decoding_backend_uninit__libvorbis, + ma_decoding_backend_get_encoding_format__libvorbis +}; +const ma_decoding_backend_vtable* ma_decoding_backend_libvorbis = &g_ma_decoding_backend_vtable_libvorbis; + #endif /* miniaudio_libvorbis_c */ diff --git a/extras/decoders/libvorbis/miniaudio_libvorbis.h b/extras/decoders/libvorbis/miniaudio_libvorbis.h index 55145748..24994fbf 100644 --- a/extras/decoders/libvorbis/miniaudio_libvorbis.h +++ b/extras/decoders/libvorbis/miniaudio_libvorbis.h @@ -33,6 +33,9 @@ MA_API ma_result ma_libvorbis_get_data_format(ma_libvorbis* pVorbis, ma_format* MA_API ma_result ma_libvorbis_get_cursor_in_pcm_frames(ma_libvorbis* pVorbis, ma_uint64* pCursor); MA_API ma_result ma_libvorbis_get_length_in_pcm_frames(ma_libvorbis* pVorbis, ma_uint64* pLength); +/* Decoding backend vtable. This is what you'll plug into ma_decoder_config.pBackendVTables. No user data required. */ +extern const ma_decoding_backend_vtable* ma_decoding_backend_libvorbis; + #ifdef __cplusplus } #endif diff --git a/miniaudio.h b/miniaudio.h index 2e60804a..2c57d6c7 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -64293,7 +64293,7 @@ MA_API ma_decoder_config ma_decoder_config_init(ma_format outputFormat, ma_uint3 return config; } -MA_API ma_decoder_config ma_decoder_config_init_default() +MA_API ma_decoder_config ma_decoder_config_init_default(void) { return ma_decoder_config_init(ma_format_unknown, 0, 0); }