Go to the documentation of this file.
27 #define MINIAUDIO_IMPLEMENTATION
28 #include "../../miniaudio.h"
29 #include "../miniaudio_engine.h"
32 #include <emscripten.h>
34 void main_loop__em(
void* pUserData)
64 printf(
"No input file.");
76 printf(
"Failed to initialize device.");
102 printf(
"Failed to initialize the resource manager.");
114 printf(
"Failed to load sound \"%s\".",
argv[1]);
123 printf(
"Failed to start device.");
127 #ifdef __EMSCRIPTEN__
128 emscripten_set_main_loop_arg(main_loop__em, &resourceManager, 0, 1);
130 printf(
"Press Enter to quit...\n");
ma_uint32 decodedChannels
ma_uint32 decodedSampleRate
void ma_device_uninit(ma_device *pDevice)
ma_result ma_device_start(ma_device *pDevice)
MA_API ma_result ma_resource_manager_data_source_init(ma_resource_manager *pResourceManager, const char *pName, ma_uint32 flags, const ma_pipeline_notifications *pNotifications, ma_resource_manager_data_source *pDataSource)
@ ma_device_type_playback
MA_API ma_result ma_resource_manager_data_source_uninit(ma_resource_manager_data_source *pDataSource)
#define MA_DATA_SOURCE_FLAG_ASYNC
ma_device_callback_proc dataCallback
MA_API void ma_resource_manager_uninit(ma_resource_manager *pResourceManager)
MA_API ma_result ma_resource_manager_process_next_job(ma_resource_manager *pResourceManager)
MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config *pConfig, ma_resource_manager *pResourceManager)
#define MA_RESOURCE_MANAGER_FLAG_NO_THREADING
#define MA_DATA_SOURCE_FLAG_DECODE
void data_callback(ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount)
MA_API ma_resource_manager_config ma_resource_manager_config_init(void)
#define MA_DATA_SOURCE_FLAG_STREAM
ma_device_config ma_device_config_init(ma_device_type deviceType)
ma_result ma_device_init(ma_context *pContext, const ma_device_config *pConfig, ma_device *pDevice)
struct ma_device::@115 playback
int main(int argc, char **argv)