fix: register remote speaker in playback worklet (addSpeaker) — voice chat was silent because worklet never knew about speakers

This commit is contained in:
Mk 2026-05-26 19:40:17 +00:00
parent eaef5b2205
commit 79fc30945a
2 changed files with 5 additions and 1 deletions

View File

@ -1780,6 +1780,10 @@ registerProcessor('voice-playback', VoicePlaybackProcessor);
sp.gainNode.gain.value = 0; // Start silent sp.gainNode.gain.value = 0; // Start silent
remoteSpeakers.set(socketId, sp); remoteSpeakers.set(socketId, sp);
// Register speaker in playback worklet
if (playbackNode) {
playbackNode.port.postMessage({ type: 'addSpeaker', id: socketId, gain: sp.gainNode.gain.value, pan: sp.pannerNode.pan.value });
}
initDecoderForSpeaker(socketId, codec); initDecoderForSpeaker(socketId, codec);
return sp; return sp;
} }

View File

@ -94,6 +94,6 @@
</div> </div>
</div> </div>
<script src="game.js?v=27"></script> <script src="game.js?v=37"></script>
</body> </body>
</html> </html>