You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys.
I'm trying to play PCM audio received via Web sockets.
Everything is cool except playing is occurring after a 1-second delay. Every time I speak at the server microphone, a 1-second delay occurs before the PCMPlayer plays it.
I tried to investigate the source code but didn't find a solution.
Also, I am convinced that the server side sends sound data accurately.
Could you help me to find a workaround?
Let me show you the code of my player class:
initPlayer() {
this.player = new PCMPlayer({
encoding: '16bitInt',
channels: 1,
sampleRate: 8000,
flushingTime: 100 // 1, 400, 1000 tested, no effect
});
}
play(data) { // data retrieved from WebSockets
const dataArray = new Uint8Array(data);
if (this.player) {
this.player.feed(dataArray);
}
}
The text was updated successfully, but these errors were encountered:
Hi guys.
I'm trying to play PCM audio received via Web sockets.
Everything is cool except playing is occurring after a 1-second delay. Every time I speak at the server microphone, a 1-second delay occurs before the PCMPlayer plays it.
I tried to investigate the source code but didn't find a solution.
Also, I am convinced that the server side sends sound data accurately.
Could you help me to find a workaround?
Let me show you the code of my player class:
initPlayer() {
this.player = new PCMPlayer({
encoding: '16bitInt',
channels: 1,
sampleRate: 8000,
flushingTime: 100 // 1, 400, 1000 tested, no effect
});
}
The text was updated successfully, but these errors were encountered: