From 9187bb4371a99dd9e715107353d81d51848711c4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 5 Jan 2020 23:33:07 +0100 Subject: [PATCH] use local codec for fft, too --- htdocs/lib/AudioEngine.js | 6 +++++- htdocs/openwebrx.js | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/AudioEngine.js b/htdocs/lib/AudioEngine.js index 298046b..6226825 100644 --- a/htdocs/lib/AudioEngine.js +++ b/htdocs/lib/AudioEngine.js @@ -230,10 +230,14 @@ AudioEngine.prototype.getBuffersize = function() { }; function ImaAdpcmCodec() { + this.reset(); +} + +ImaAdpcmCodec.prototype.reset = function() { this.stepIndex = 0; this.predictor = 0; this.step = 0; -} +}; ImaAdpcmCodec.imaIndexTable = [ -1, -1, -1, -1, 2, 4, 6, 8, -1, -1, -1, -1, 2, 4, 6, 8 ]; diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 29dd3e7..7017fc8 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -29,7 +29,7 @@ var center_freq; var fft_size; var fft_fps; var fft_compression = "none"; -var fft_codec = new sdrjs.ImaAdpcm(); +var fft_codec; var waterfall_setup_done = 0; var secondary_fft_size; var rx_photo_state = 1; @@ -1942,6 +1942,7 @@ function openwebrx_init() { } else { audioEngine.start(onAudioStart); } + fft_codec = new ImaAdpcmCodec(); initProgressBars(); init_rx_photo(); open_websocket();