Author Topic: How can I stop and restart a stream?  (Read 208 times)

scarboni

  • Posts: 32
How can I stop and restart a stream?
« on: 20 Nov '20 - 08:34 »
Hello !

I have a stream to icecast/shoutcast server, that I want to be able to "plug and unplug".  I want to allow my user to start streaming, and then stop, stopping the connection as a whole, and if they want later on, start a new connection.

What is the clean way to do so? To be able to keep playing my stream locally without interruption, and then by moment, stream it to a server or not.

Ian @ un4seen

  • Administrator
  • Posts: 23311
Re: How can I stop and restart a stream?
« Reply #1 on: 20 Nov '20 - 13:11 »
You can use BASS_Encode_Stop to stop an encoder (and the casting on it). When you want to restart it, create a new encoder like you did the first time. Neither of those steps should affect the local playback.

scarboni

  • Posts: 32
Re: How can I stop and restart a stream?
« Reply #2 on: 27 Nov '20 - 14:38 »
Thank you ! It worked great. :)
I wasn't using the right function to stop it before.