diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-25 15:51:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 15:51:42 +0200 |
commit | ab3d7f29a83670063f616ea9825231914bb08124 (patch) | |
tree | d93e01fbf5a1bdc3aa75d0e93a27a9d2def0fa39 | |
parent | 78f554a839c298698de899efcdf6f49b83179402 (diff) | |
parent | 57bdb4cc35c09697169f65943973a42f9d35678c (diff) |
Merge pull request #39037 from Faless/js/audio_latency
Fix JS audioContext parameters.
-rw-r--r-- | platform/javascript/audio_driver_javascript.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index b52bd4ce60..b8914414e6 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -70,14 +70,14 @@ Error AudioDriverJavaScript::init() { /* clang-format off */ _driver_id = EM_ASM_INT({ const MIX_RATE = $0; - const LATENCY = $1; + const LATENCY = $1 / 1000; return Module.IDHandler.add({ 'context': new (window.AudioContext || window.webkitAudioContext)({ sampleRate: MIX_RATE, latencyHint: LATENCY}), 'input': null, 'stream': null, 'script': null }); - }); + }, mix_rate, latency); /* clang-format on */ int channel_count = get_total_channels_by_speaker_mode(get_speaker_mode()); |