Hey i am not getting audio how to check it in serv...
# ask-ai
h
Hey i am not getting audio how to check it in server i am using node rtc so help me in this
t
Thanks for reaching out, Vishal. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's work together to troubleshoot the "no audio" issue you're experiencing in LiveKit using Node RTC. Here are some steps that can guide you through the process: 1. Check Audio Publishing and Device Access: You can use the
PublishAudioCheck
class to see if audio is being published correctly. For example:
Copy code
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:
Copy code
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:
Copy code
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!