Go to the documentation of this file.
5 #define MINIAUDIO_IMPLEMENTATION
6 #include "../external/miniaudio/miniaudio.h"
43 printf(
"Failed to open file \"%s\"", pFilePath);
49 printf(
"Failed to init MP3 decoder \"%s\"", pFilePath);
58 printf(
"Failed to open file \"%s\"", pFilePath);
77 if (pcmFrameCountMemory != pcmFrameCountFile) {
78 printf(
"Frame counts differ: memory = %d; file = %d\n", (
int)pcmFrameCountMemory, (
int)pcmFrameCountFile);
85 for (iSample = 0; iSample < pcmFrameCountMemory * mp3Memory.
channels; iSample += 1) {
86 if (pcmFramesMemory[iSample] != pcmFramesFile[iSample]) {
87 printf(
"Samples differ: memory = %d; file = %d\n", (
int)pcmFramesMemory[iSample], (
int)pcmFramesFile[iSample]);
94 if (pcmFrameCountMemory == 0 || pcmFrameCountFile == 0) {
112 const char* pInputFilePath;
115 printf(
"No input file.\n");
119 pInputFilePath =
argv[1];
128 printf(
"Failed to open file \"%s\"", pInputFilePath);
153 printf(
"Press Enter to quit...");
DRMP3_API void drmp3_uninit(drmp3 *pMP3)
void ma_device_uninit(ma_device *pDevice)
unsigned long long drmp3_uint64
ma_result ma_device_start(ma_device *pDevice)
DRMP3_API drmp3_bool32 drmp3_init_memory(drmp3 *pMP3, const void *pData, size_t dataSize, const drmp3_allocation_callbacks *pAllocationCallbacks)
DRMP3_API drmp3_bool32 drmp3_init_file(drmp3 *pMP3, const char *pFilePath, const drmp3_allocation_callbacks *pAllocationCallbacks)
int main(int argc, char **argv)
@ ma_device_type_playback
ma_device_callback_proc dataCallback
DRMP3_API drmp3_uint64 drmp3_read_pcm_frames_s16(drmp3 *pMP3, drmp3_uint64 framesToRead, drmp3_int16 *pBufferOut)
void * dr_open_and_read_file(const char *filePath, size_t *pFileSizeOut)
const char * ma_result_description(ma_result result)
int do_decoding_validation(const char *pFilePath)
ma_device_config ma_device_config_init(ma_device_type deviceType)
void data_callback(ma_device *pDevice, void *pFramesOut, const void *pFramesIn, ma_uint32 frameCount)
DRMP3_API drmp3_uint64 drmp3_read_pcm_frames_f32(drmp3 *pMP3, drmp3_uint64 framesToRead, float *pBufferOut)
ma_result ma_device_init(ma_context *pContext, const ma_device_config *pConfig, ma_device *pDevice)
struct ma_device_config::@97 playback
struct ma_device::@115 playback