hallowed-rose-90916
09/11/2025, 3:02 PMtall-airline-16756
09/11/2025, 3:02 PMtall-airline-16756
09/11/2025, 3:03 PMPublishAudioCheck
class to see if audio is being published correctly. For example:
const track = await createLocalAudioTrack();
const trackIsSilent = await detectSilence(track, 1000);
if (trackIsSilent) {
throw new Error('unable to detect audio from microphone');
}
If you find silence here, it might be caused by software noise suppression or simply a delay in speaking—something quite common.
1. Validate Audio Source Configuration: It’s a good idea to check that the internal frame queue isn’t overloaded. You can try increasing the queue_size_ms
parameter like this:
const source = new AudioSource(sampleRate, channels, { queue_size_ms: 2000 });
1. Ensure Correct Frame Format: When you’re capturing audio frames, make sure the data buffer is in the right format (Int16Array
). Also, using buffer.subarray()
instead of buffer.slice()
can help avoid some common issues.
2. Monitor Connection and Track Publishing: After publishing your track, take a moment to check the RTC statistics to confirm audio packets are being sent, like so:
await new Promise(resolve => setTimeout(resolve, 3000));
const stats = await track.sender?.getStats();
1. Verify Subscription and Playback: Make sure the audio track is subscribed to and properly attached to an audio element for playback.
2. Enable Debugging Logs: Setting the logLevel
in your connection options can give you more detailed insights if something goes wrong.
I hope these steps help you get to the bottom of the issue. Please feel free to reach out if you need any more help—I’m here to support you!