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
Basically, I did everything as described here https://github.com/livekit/server-sdk-go?tab=readme-ov-file#publishing-tracks-to-room
adapting only to audio files.
In about 90% of the cases, the first second or even several seconds are missed and I don't hear them on the client side.
It should be possible to somehow make sure that all clients subscribed to the track before publishing it.
The text was updated successfully, but these errors were encountered:
This is a bit tricky due to the subscription lifecycle. the current logic in NewLocalReaderTrack is to start writing the file as soon as the track is considered published:
track.OnBind(func() {
if err := track.StartWrite(provider, provider.OnWriteComplete); err != nil {
logger.Errorw("Could not start writing", err)
}
})
There isn't really a way to know when all of the the subscribers have subscribed to the track.. but I think you can modify this function to do the following:
construct an empty opus packet: see here for an example
write it with track.WriteRTP, this lets server complete the publication process
sleep for a few seconds to give subscribers time to subscribe
Is there a ready-to-use method to publish an audio file without missing the beginning parts? It's quite strange that this is an issue in such a large streaming ecosystem. Specifically, my case is 1-to-1 prerecorded audio file streaming
I created a very simple server that sends ogg OPUS audio files to web clients.
Basically, I did everything as described here https://github.com/livekit/server-sdk-go?tab=readme-ov-file#publishing-tracks-to-room
adapting only to audio files.
In about 90% of the cases, the first second or even several seconds are missed and I don't hear them on the client side.
It should be possible to somehow make sure that all clients subscribed to the track before publishing it.
The text was updated successfully, but these errors were encountered: