I would like to be able to play internet radio music.
Can someone provide me with some guidelines/code example how it can be done?
All the discussions in the forum on this topic were not useful…
Thanks,
Yair
I would like to be able to play internet radio music.
Can someone provide me with some guidelines/code example how it can be done?
All the discussions in the forum on this topic were not useful…
Thanks,
Yair
There are a lot of tools and services made for this before. Some are services that you should pay for, and some are free tools that you can configure and use to build this system.
BUT if you want to make it yourself:
You basically need to use a music player library and a server. You must have all of the sound files that needs to be streamed on the server. The server constantly streams the queue to the server. If there is a host platform involved (like you want to stream on YouTube), the server must be connected to the streaming service through its API. If the radio is part of a website, I recommend making the radio a separate service which the website uses.
I think the easiest way would be to code this with Python. If you have more time, you can use Django/Django REST/Flask to make a proper service that also has a ui that enables you to:
However I’m sure they have made tools for Django and Flask to make this job way more easier to implement. Also, if you want to stream music on a video platform like YouTube/Twitch, you need to first convert the music stream to a video stream and then stream the video.
Check out this link, there are a lot of useful softwares and libraries there.
I need to develop the player, that will be able to connect to free internet radio stations and play their content.
I would like to use JUCE, as there are several DSP processing features I would like to add to such a player.
Unfortunately all AudioFormatReaders, that JUCE implements, are only geared towards file reading, none is streaming capable. MP3 would theoretically allow streaming, but the JUCE implementation needs the file length to be known in advance, which is the major difference in streams.
Take a look also at superpowered SDK. Advanced features may cost some license fee but when I used their C++ “advanced” player a couple years ago it was pretty powerful.
Player (c++ version) could do http streaming , play hls, play protected content by setting up appropriate headers/tokens, synchronize streams and apply some basic fx.
When you say “Player (c++ version)” do you mean the Superpowered player?
Also, my main reason to use JUCE is its ability to allow me to perform the required DSP processing on the audio .
Do you know of any way/solution that will allow me to do it in C++?
Yes,
C++ “Advanced Player” has all the possible playback/sync features.
The web counterpart is (at least was last time a checked) much simpler due to lots of multithreading happening behind the scenes in the advanced audio player, even tough if you look ad the docs it looks like it’s catching up.
As far as I remember Superpowered has a “processAudioBuffer” callback paradigm very similar to JUCE, so you could link superpowered sdk in a juce audio app project, and have the advanced audio player work along with the juce callback (properly feeding what superpowered needs in term of audio buffers- time advance). warning : Superpowered advanced audio player costs a license fee.
Of course a playing back “local” audio + applying DSP is perfectly in the scope of juce … you only miss the http stream or HLS part, which SuperpoweredAdvancedplayer would give you out of the box.
As alternatives I’d explore: