revert: simplify listen to PCM-only, remove WebCodecs complexity

- Remove broadcastOpusToWeb from types and webserver
- Revert recorder to PCM-only broadcast path
- Remove WebCodecs AudioDecoder from dashboard.js
- Simplify WebSocket handler to just play PCM frames
- Remove Howler.js and Tone.js dependencies
- Keep simple AudioContext playback that works reliably
This commit is contained in:
MythEclipse
2026-05-13 22:26:59 +07:00
parent 3dbe3105af
commit 0f30a4aa67
6 changed files with 2 additions and 35 deletions

View File

@@ -11,9 +11,6 @@ const state = {
processor: null,
nextStartTime: 0,
noiseGateHold: 0,
opusDecoder: null,
opusDecoderReady: false,
opusDecodeQueue: [],
};
const SAMPLE_RATE = 24000;
@@ -165,19 +162,7 @@ const state = {
handleJsonEvent(event.data);
return;
}
if (!state.isListening) return;
const bytes = new Uint8Array(event.data);
if (bytes.byteLength < 5) {
playPcm(event.data);
return;
}
const mode = bytes[0];
if (mode === 1) {
const opusData = bytes.slice(5);
decodeOpus(opusData);
} else {
playPcm(event.data);
}
if (state.isListening) playPcm(event.data);
};
}