1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

serialport reconnect rework - v1.3.0.1

This commit is contained in:
Amateur Audio Dude
2024-09-23 17:48:46 +10:00
committed by GitHub
parent 8b265ecf71
commit a7931257d5

View File

@@ -1,3 +1,4 @@
var audioStreamRestartInterval;
var elapsedTimeConnectionWatchdog;
var _3LAS_Settings = /** @class */ (function () {
function _3LAS_Settings() {
@@ -48,6 +49,20 @@ var _3LAS = /** @class */ (function () {
this.ConnectivityFlag = false;
this.Stop(); // Attempt to mitigate the 0.5x speed/multiple stream bug
// Restart audio stream if radio data connection was reestablished
// to prevent stuttering audio in some cases
if (audioStreamRestartInterval) {
clearInterval(audioStreamRestartInterval);
}
audioStreamRestartInterval = setInterval(() => {
if (requiresAudioStreamRestart) {
requiresAudioStreamRestart = false;
this.Stop();
this.Start();
console.log("Audio stream restarted after radio data loss.");
}
}, 3000);
// Stream connection watchdog monitors mp3 frames
console.log("Stream connection watchdog active.");
let intervalReconnectWatchdog = setInterval(() => {