diff options
Diffstat (limited to 'platform/javascript/audio_driver_javascript.cpp')
-rw-r--r-- | platform/javascript/audio_driver_javascript.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index 4144eb3499..f1bc7c4382 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -63,7 +63,7 @@ void AudioDriverJavaScript::mix_to_js() { void AudioDriverJavaScript::process_capture(float sample) { int32_t sample32 = int32_t(sample * 32768.f) * (1U << 16); - capture_buffer_write(sample32); + input_buffer_write(sample32); } Error AudioDriverJavaScript::init() { @@ -198,7 +198,7 @@ void AudioDriverJavaScript::finish() { Error AudioDriverJavaScript::capture_start() { - capture_buffer_init(buffer_length); + input_buffer_init(buffer_length); /* clang-format off */ EM_ASM({ @@ -245,6 +245,8 @@ Error AudioDriverJavaScript::capture_stop() { }); /* clang-format on */ + input_buffer.clear(); + return OK; } |