Snapcast: Add stream for URL (WebRadio)

Created on 24 Mar 2020  路  2Comments  路  Source: badaix/snapcast

Hello,

I would like to be able to add, via the Snapcast API and the Stream.AddStream method, the URL of a stream.

This could easily read WebRadio from a given url (http://129.122.92.10:88/broadwavehigh.mp3 for example) directly thanks to the API, indicating the URL of the WebRadio in the JSON frame.

This would allow, thanks to the Stream.RemoveStream method to easily add and remove WebRadio via the API.

Is it possible ?

If so, what parameters should we indicate in the streamUri field?

Thank you !

Most helpful comment

I've never used the Stream.AddStream and Stream.RemoveStream methods, but with help of the player setup guide, this seems to work quite well:
Add in snapserver.conf in the [stream] section (this should also be possible using the Stream RPC command):

stream = process:///usr/bin/mpv?name=Webradio&sampleformat=48000:16:2&params=http://129.122.92.10:88/broadwavehigh.mp3 --no-terminal --audio-display=no --audio-channels=stereo --audio-samplerate=48000 --audio-format=s16 --ao=pcm:file=/dev/stdout

Of course, you need to have mpv installed.

All 2 comments

I've never used the Stream.AddStream and Stream.RemoveStream methods, but with help of the player setup guide, this seems to work quite well:
Add in snapserver.conf in the [stream] section (this should also be possible using the Stream RPC command):

stream = process:///usr/bin/mpv?name=Webradio&sampleformat=48000:16:2&params=http://129.122.92.10:88/broadwavehigh.mp3 --no-terminal --audio-display=no --audio-channels=stereo --audio-samplerate=48000 --audio-format=s16 --ao=pcm:file=/dev/stdout

Of course, you need to have mpv installed.

interpreting the :+1: reaction as the problem is solved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dantheperson picture dantheperson  路  4Comments

jameyg picture jameyg  路  5Comments

fuchsmich picture fuchsmich  路  3Comments

Daargajedan picture Daargajedan  路  7Comments

jreusch picture jreusch  路  5Comments