Streaming audio from SoundPlay

SoundPlay 4.0 is capable of delivering music in the current playlist to listeners anywhere on the Internet, or elsewhere on a local TCP/IP network. This makes it easy to keep a playlist running at home and tune into it from work, or to run your own Internet „radio station.“
There are two streaming methods supported in SoundPlay 4.0: pseudo- streaming / download and real-time streaming (of course you can still run standard .m3u pseudo streams if you like.)

Pseudo-Streaming / Remote Control

With a pseudo-streaming server, files are dished up at their actual bitrates and sizes, which is usually not very bandwidth-friendly. Files will not be downsampled, so a 3MB MP3 will mean a 3MB transfer. Pseudo streaming does, however, give the client random access capabilities, so they can skip around in your playlist at will.
SoundPlay 4.0 includes its own mini HTTP server, capable of dishing up web pages showing the current playlist, and optionally populated with Play, Download, and Stream links. The server runs on port 8080 of your current IP address, and does not require you to run a separate web server (but note that because it runs on a separate port, it will not conflict with a standard web server running on the same machine). To use it, you must know your current IP address, which you can get from the DUN config panel or by typing netstat into a Terminal. Things will be a lot easier if you have a static, rather than dynamic IP.
To enable this feature, go to Preferences | Plugins | General Purpose and select HTTP Interface. Click Configure, and select appropriate output options.
Show File Info: This will send the bitrate and playing time of each track to the client browser along with filenames.
Enable play links: This link is used only for controlling the remote machine. Clicking a Play link will not cause it to play on the client machine, but will make SoundPlay on the other machine jump to that song.
Enable download links: Obviously, clicking a Download link will let the client download a copy of the MP3 file to their own machine. Unfortunately, downloaded files always come through with the name dlod.mp3, rather than the actual file name (in Internet Explorer anyway; this may be a fixable bug… stay tuned). Note that you’ll need to own the copyright of each track if you intend to implement this and want to stay legal. It is illegal to offer copyrighted music to others for download.
Enable stream links: Clicking a Stream link will send the selected track to the client’s preferred MP3 player in real-time, without letting them save the MP3 as a file on their hard drive.
Once configured, make sure the HTTP Interface is enabled, then test the configuration from another machine by appending :8080 to the IP address. For example, if the SoundPlay machine’s IP address on a local network is, the client machine would enter Real IP addresses and domain names also work, of course. Unfortunately, the port address in this version of HTTP Interface is not configurable.

Real-Time Streaming

Through a separate interface, SoundPlay 4.0 offers the ability to do real- time streaming, via a „Live Encoder“ plugin. In this configuration, the user (client) cannot skip around in your playlist — they simply hear whatever you’re playing at any given moment, like a radio station. Whereas the HTTP Interface is limited to controlling / accessing one track at a time, the Live Encoder streams whatever is currently runnng through SoundPlay to the outside world. More importantly, it lets you „downsample“ the stream to Internet-friendly rates, making it possible to serve modem users. Of course, you’ll have to compromise somewhere on the spectrum between available client bandwidth and audio quality.
The Live Encoder works by piping the stream through an MP3 encoder elsewhere on your system, which handles the downsampling (if any). The Live Encoder then routes the stream back out on a port address of your choosing. Therefore, you’ll find the Live Encoder in the Filters section of the Plugins panel.
In order to use the Live Encoder, you’ll need to install the LAME encoder on your system (preferably in ~/config/bin) No, you can’t use GOGO for this, as GOGO always outputs to a file, not to stdout, which is required for this setup. In the Live Encoder config panel, you’ll see that you can send various command line flags to LAME. The default configuration is:

/boot/home/config/bin/lame -b 64 -x -r - -

This tells lame to re-encode the stream at 64kbps, to use raw PCM as input, and to force byte swapping. The - - are actually two separate flags, which tell LAME to accept input from stdin and send output to stdout.
The default configuration should work well, but if your clients are on a fast network, you’ll probably want to change the bitrate to 128kbps or higher to ensure better quality.
It’s important that you set the streaming buffer setting in the receiving MP3 player to match or exceed the bitrate at which the stream is being sent. If you serve at 128kbps but WinAmp (for example) has a streaming buffer setting of 64kbps, the client will get choppy audio.
Conversely, if you’re serving to modem users, you’ll want to downsample your stream to make it more network friendly. However, it is not sufficient to just click the „Halve samplerate“ or „Make mono“ checkboxes. If you check these, you must modify the encoder flags. Specify a halved samplerate with -s 22.05, and make mono with -m m (-m is for mode; type „lame“ into a terminal to see all of its possible flags). Therefore, to send a 64kbps mono stream at 22.05KHz, use:

/boot/home/config/bin/lame -b 64 -m m -s 22.05 -x -r - - 

Experiment with mono/stereo, various bitrates, and full/half samplerate until you find a combination that works well for the speed at which your users are connecting.
To offer access to your live MP3 stream, hand out your IP address with the port address specified in the Live Encoder panel (the default is 8000). For example, The user should enter or paste this directly into their MP3 player, not into their browser.
Note that while the Live Encoder plug-in is very similar in concept to ShoutCAST / icecast / live365, the current version does not include a mechanism to send meta-data to those sites, so you cannot have your stream automatically listed in their databases. However, live365 makes it possible to register streams manually, so you can theoretically get your stream listed. Unfortunately, a bug somewhere in the system is currently preventing this system from working as it should.



No comments so far.

(comments are closed)