From 1ab91b05c02035e16ed589951b542004a9eefba0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 5 Mar 2025 14:58:59 +1000 Subject: [PATCH] Delete a duplicate example. --- examples/engine_custom_decoder.c | 78 -------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 examples/engine_custom_decoder.c diff --git a/examples/engine_custom_decoder.c b/examples/engine_custom_decoder.c deleted file mode 100644 index f4e1eee4..00000000 --- a/examples/engine_custom_decoder.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -Demonstrates how to implement a custom decoder and use it with the high level API. - -This is the same as the custom_decoder example, only it's used with the high level engine API -rather than the low level decoding API. You can use this to add support for Opus to your games, for -example (via libopus). -*/ -#define MINIAUDIO_IMPLEMENTATION -#include "../miniaudio.h" -#include "../extras/miniaudio_libvorbis.h" -#include "../extras/miniaudio_libopus.h" - -#include - -int main(int argc, char** argv) -{ - ma_result result; - ma_resource_manager_config resourceManagerConfig; - ma_resource_manager resourceManager; - ma_engine_config engineConfig; - 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. - */ - const ma_decoding_backend_vtable* pCustomBackendVTables[] = - { - ma_decoding_backend_libvorbis, - ma_decoding_backend_libopus, - ma_decoding_backend_wav, - ma_decoding_backend_flac, - ma_decoding_backend_mp3 - }; - - - if (argc < 2) { - printf("No input file.\n"); - return -1; - } - - - /* Using custom decoding backends requires a self-managed resource manager. */ - resourceManagerConfig = ma_resource_manager_config_init(); - resourceManagerConfig.ppDecodingBackendVTables = pCustomBackendVTables; - resourceManagerConfig.decodingBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]); - - result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager); - if (result != MA_SUCCESS) { - printf("Failed to initialize resource manager."); - return -1; - } - - - /* Once we have a resource manager we can create the engine. */ - engineConfig = ma_engine_config_init(); - engineConfig.pResourceManager = &resourceManager; - - result = ma_engine_init(&engineConfig, &engine); - if (result != MA_SUCCESS) { - printf("Failed to initialize engine."); - return -1; - } - - - /* Now we can play our sound. */ - result = ma_engine_play_sound(&engine, argv[1], NULL); - if (result != MA_SUCCESS) { - printf("Failed to play sound."); - return -1; - } - - - printf("Press Enter to quit..."); - getchar(); - - return 0; -} \ No newline at end of file