Commit 51ebb048 authored by David Reid's avatar David Reid

Work in progress for full-duplex for WebAudio.

parent 212cee59
This diff is collapsed.
...@@ -2244,13 +2244,13 @@ void on_send__playback_test(mal_device* pDevice, void* pOutput, const void* pInp ...@@ -2244,13 +2244,13 @@ void on_send__playback_test(mal_device* pDevice, void* pOutput, const void* pInp
mal_event_signal(&pData->endOfPlaybackEvent); mal_event_signal(&pData->endOfPlaybackEvent);
} }
#else #else
if (pDevice->format == mal_format_f32) { if (pDevice->playback.format == mal_format_f32) {
for (mal_uint32 iFrame = 0; iFrame < frameCount; ++iFrame) { for (mal_uint32 iFrame = 0; iFrame < frameCount; ++iFrame) {
float sample; float sample;
mal_sine_wave_read_f32(pData->pSineWave, 1, &sample); mal_sine_wave_read_f32(pData->pSineWave, 1, &sample);
for (mal_uint32 iChannel = 0; iChannel < pDevice->channels; ++iChannel) { for (mal_uint32 iChannel = 0; iChannel < pDevice->playback.channels; ++iChannel) {
((float*)pFrames)[iFrame*pDevice->channels + iChannel] = sample; ((float*)pOutput)[iFrame*pDevice->playback.channels + iChannel] = sample;
} }
} }
} }
...@@ -2296,7 +2296,7 @@ int do_playback_test(mal_backend backend) ...@@ -2296,7 +2296,7 @@ int do_playback_test(mal_backend backend)
#if defined(__EMSCRIPTEN__) #if defined(__EMSCRIPTEN__)
deviceConfig.format = mal_format_f32; deviceConfig.playback.format = mal_format_f32;
#endif #endif
result = mal_device_init_ex(&backend, 1, &contextConfig, &deviceConfig, &device); result = mal_device_init_ex(&backend, 1, &contextConfig, &deviceConfig, &device);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment