Go to the documentation of this file.
15 #define MA_NO_DECODING
16 #define MA_NO_ENCODING
17 #define MINIAUDIO_IMPLEMENTATION
18 #include "../miniaudio.h"
23 #include <emscripten.h>
30 #define DEVICE_FORMAT ma_format_f32
31 #define DEVICE_CHANNELS 2
32 #define DEVICE_SAMPLE_RATE 48000
66 printf(
"Failed to open playback device.\n");
73 printf(
"Failed to start playback device.\n");
79 emscripten_set_main_loop(main_loop__em, 0, 1);
81 printf(
"Press Enter to quit...\n");
void ma_device_uninit(ma_device *pDevice)
ma_result ma_device_start(ma_device *pDevice)
@ ma_device_type_playback
ma_device_callback_proc dataCallback
void data_callback(ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount)
ma_result ma_waveform_init(const ma_waveform_config *pConfig, ma_waveform *pWaveform)
int main(int argc, char **argv)
#define DEVICE_SAMPLE_RATE
ma_waveform_config ma_waveform_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_waveform_type type, double amplitude, double frequency)
ma_device_config ma_device_config_init(ma_device_type deviceType)
ma_uint64 ma_waveform_read_pcm_frames(ma_waveform *pWaveform, void *pFramesOut, ma_uint64 frameCount)
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