Go to the documentation of this file.
2 #define MINIAUDIO_IMPLEMENTATION
3 #include "../miniaudio.h"
8 #include <emscripten.h>
15 #define DEVICE_FORMAT ma_format_f32
16 #define DEVICE_CHANNELS 2
17 #define DEVICE_SAMPLE_RATE 48000
51 printf(
"Failed to open playback device.\n");
58 printf(
"Failed to start playback device.\n");
64 emscripten_set_main_loop(main_loop__em, 0, 1);
66 printf(
"Press Enter to quit...\n");
void ma_device_uninit(ma_device *pDevice)
ma_result ma_device_start(ma_device *pDevice)
void data_callback(ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount)
@ ma_device_type_playback
ma_device_callback_proc dataCallback
int main(int argc, char **argv)
ma_result ma_waveform_init(const ma_waveform_config *pConfig, ma_waveform *pWaveform)
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
#define DEVICE_SAMPLE_RATE