-
Hi guys, Recently I have been using this snippet https://github.com/pion/webrtc/tree/master/examples/play-from-disk to stream some audio files. as I am so new on this part, I got these two issues: first, I am trying to find out how I can start the streaming from a specific second. I would really appreciate it if you give me some tips on these issues I have. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @hamedbrd
In play-from-disk here we loop the file and compute the duration of each ogg page. I would start with discarding samples until it reaches the time you want to start playing. For pause you could Stop/Sleep in the same loop. If you want to start a repo with edits I am happy to review any changes you make! |
Beta Was this translation helpful? Give feedback.
-
Thanks, @Sean-Der for your answer I am handling it by discarding samples like this now
just before this line but I am not sure this is a proper way to handle this. how about if we decide to jump to the second 10 from the second 40? |
Beta Was this translation helpful? Give feedback.
Hi @hamedbrd
In play-from-disk here we loop the file and compute the duration of each ogg page. I would start with discarding samples until it reaches the time you want to start playing.
For pause you could Stop/Sleep in the same loop.
If you want to start a repo with edits I am happy to review any changes you make!