Issue
I have done streaming of audio files from a server but now I have a project that requires streaming of a local radiostation. I will not have any access to them from inside though.
I found 'radioshark' as an option for capturing the stream but it would take a big amount of time to upload it to the server and stream for there and it cannot be called 'live' anymore.
Is there any way to do this with minimum of steps?
Typically, it will require capturing object to act as a server that can instantly stream the same. Also, the capturing process is continuous, so the captured file cannot be expected in a closed format.
Solution
According to Amazon the Radio Shark is no longer being manufactured and is only sold by 3rd parties who still have it in their inventory. This means that it wouldn't be a good idea to base a solution around Radio Shark. Even if it was in production it is unique and proprietary, facts that tightly couple your solution to particular hardware.
Raspberry Pi is another complication because it does not have a microphone jack. You would need to record via USB input. Your choice of applications or APIs to drive the recording and streaming also becomes much more limited because the platform is limited, especially where drivers are concerned.
But regardless of platform/OS this is your simplest hardware & server architecture:
Any radio w/ mic or line-out with >> 3.5mm Line Out Cable (could be 3.5mm to USB) connected to >> computer with line-in or microphone (or USB) running >> recording software >> >> streaming software >> >> internet >> people listening
Notes:
- You did not specify a programming language or framework. Only RPi is mentioned as a specific technology (besides Radio Shark). That said I'm coming from a fairly high-level view that could be used on a variety of platforms e.g. .NET on Windows, Java on Linux and perhaps Mono on RPi?
- The radio can really be ANY kind of radio as long as it has a line-out (or headphone jack)
- The cable is easy as well. Here is a 3.5 mm to 3.5 mm version (see next note)
- Depending on the sound card and its driver software in the computer you may be able to use the microphone jack. If not then you need a sound card with a line-in or a USB solution (If you really need to use RPi then a USB to line-in adapter would be needed. Something like this.)
- The recording software depends on your platform. If you get lucky there might find a complete, off-the-shelf and free/open source solution that can record and stream the recording in near-real-time
- If unlucky then you will have to try and use two pieces of software working together but really, this is where you would have to think about writing your own. Fortunately, there are open source libraries out there for a variety of languages that make it easy to record input and other libraries/packages to stream.
Good luck!
Answered By - Paul Sasik Answer Checked By - Timothy Miller (WPSolving Admin)