Hi
I have been doing some work with Shoutcast (internet radio) recently and thought it would be fun to make a plugin to stream directly to a server from within Csound. The plugin is in my git repo here: https://git.1bpm.net/csound-shout/about/
Not tested extensively so interested for feedback if anyone has use for it.
Internally it uses LAME to stream as MP3 - might be interesting to explore that mechanism between networked Csound instances, as I've had difficulty with socksend/sockrecv for audio - seemingly due to the bandwidth required.
That's really interesting. Some years ago, I remember Tarmo set up a stream like that where we could go and interact with the server, submitting code to be played.
Using it as a means of sending audio to other instances is also an interesting idea.
Prof. Victor Lazzarini
Maynooth University
Ireland
Brilliant! This is very nice, thank you! I built in and tested on local openSuse Linux machine with icecast server - everything went smoothly and worked as expected.
The only thing I noticed is that running this plugin, Csound eats a lot of CPU - that is a bit of a problem.
It is so convenient to have such and opcode to stream straight from Csound to the broadcasting server! Before I used to use Csound->Jack->DarkIce for sending up the stream but this is so much more convenient.
You mentioned ‘might be interesting to
explore that mechanism between networked Csound instances’
how can the other side to receive the sound from the broadcasing server?
And of course then there is the latency problem, that is at least 5 but probably more seconds.
Just to mention - for low-latency audio transfer I find jacktrip a very good tool or Jamulus platform https://jamulus.io/ if you want to play together with several people (or Sonobus, but then the routing from/to Csound can be more difficult to achineve)
But i don’t get how and where you run the Csound file for streaming?
Greetings,
Philipp
Hi
I have been doing some work with Shoutcast (internet radio) recently and thought it would be fun to make a plugin to stream directly to a server from within Csound. The plugin is in my git repo here: https://git.1bpm.net/csound-shout/about/
Not tested extensively so interested for feedback if anyone has use for it.
Internally it uses LAME to stream as MP3 - might be interesting to explore that mechanism between networked Csound instances, as I’ve had difficulty with socksend/sockrecv for audio - seemingly due to the bandwidth required.
tor. 20. mars 2025 kl. 01:49 skrev Richard Knight <richard@1bpm.net>:
Hi
I have been doing some work with Shoutcast (internet radio) recently and
thought it would be fun to make a plugin to stream directly to a server
from within Csound. The plugin is in my git repo here: https://git.1bpm.net/csound-shout/about/
Not tested extensively so interested for feedback if anyone has use for
it.
Internally it uses LAME to stream as MP3 - might be interesting to
explore that mechanism between networked Csound instances, as I’ve had
difficulty with socksend/sockrecv for audio - seemingly due to the
bandwidth required.
Hi, the streaming happens within Csound itself.
So the connection to the server is setup with the opcodes shoutinit and shoutopen , and then you can pass audio to the shoutsend opcode.
Hi, thank you, and really interesting to hear you’ve done things with Csound and streaming before, and glad it is useful!
The MP3 encoding particularly adds some CPU usage but I haven’t found it limiting - in fact it seems lower usage than liquidsoap which I’m currently on the same machine to stream static files. But I would like to get to the bottom of it more and see how it can be optimised - what is your ksmps and does that make a difference on the load? Also maybe the quality setting might make a difference, and would you know roughly how much CPU usage it adds to your csd, just so I get an idea of how bad the problem is? I'm seeing maybe 5 additional CPU on a slow (atom type cpu) box, but with high ksmps.
With the idea between networked Csound instances, I was thinking of a new plugin that would send/receive mp3 encoded streams. And you have a great point I didn’t consider before about the latency, so maybe that’s not such a great idea. These are reallyy useful suggestions, thank you - I will have a look at jacktrip and jamulus.
If the goal is to broadcast audio over the network I would look into libaao (audio over osc): https://git.iem.at/aoo/aoo,
it is the underlying protocol used by sonobus and in my own experience it offers low latency while being cross-platform than other tools like jack trip.