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();