20 #define MINIAUDIO_IMPLEMENTATION
21 #include "../miniaudio.h"
22 #include "../extras/miniaudio_libvorbis.h"
23 #include "../extras/miniaudio_libopus.h"
35 if (pVorbis ==
NULL) {
39 result =
ma_libvorbis_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pVorbis);
41 ma_free(pVorbis, pAllocationCallbacks);
58 if (pVorbis ==
NULL) {
64 ma_free(pVorbis, pAllocationCallbacks);
80 ma_free(pVorbis, pAllocationCallbacks);
116 result =
ma_libopus_init(onRead, onSeek, onTell, pReadSeekTellUserData, pConfig, pAllocationCallbacks, pOpus);
118 ma_free(pOpus, pAllocationCallbacks);
141 ma_free(pOpus, pAllocationCallbacks);
157 ma_free(pOpus, pAllocationCallbacks);
185 if (pDataSource ==
NULL) {
217 printf(
"No input file.\n");
226 decoderConfig.
customBackendCount =
sizeof(pCustomBackendVTables) /
sizeof(pCustomBackendVTables[0]);
230 printf(
"Failed to initialize decoder.");
238 printf(
"Failed to retrieve decoder data format.");
251 printf(
"Failed to open playback device.\n");
257 printf(
"Failed to start playback device.\n");
263 printf(
"Press Enter to quit...");