Audio players

On BSD/Linux systems there are a plethora of audio players. In streamtuner2 you can configure most of them as target application. Mostly it makes sense to use a single application for all audio formats. But at least the */* media type should be handled by a generic player, like vlc.

A few common applications and invocation strings to use are:

Audacious

audacious

audio

XMMS2

xmms2 %m3u

audio

Amarok

amarok -l %pls

audio

Exaile

exaile

audio

mplayer

mplayer %srv

console

VLC

vlc %u

video

Totem

totem %u

video

Media Player

mplayer2.exe %asx

Win32

Some audio players open a second instance when you actually want to switch radios. In this case it's a common workaround to write pkill vlc ; vlc %u instead, which ends the previous player process and starts it anew. For VLC there's however also the --one-instance option, which sometimes works better. (And sometimes not.)

Some applications, like Rhythmbox or Banshee, are primarily playlist managers, not players, and cannot be invoked with a station URL. This makes them less suitable for use with streamtuner2. (Same goes for streamtuner2 itself. It's not a player, but just a playlist browser.)

URL placeholders

Listed audio players get run with a streaming server address (URL). These can either be direct MP3/Ogg servers (http://example.org:7843/) and sometimes playlist files (http://example.org/listen.pls) - depending on the channel directory.

Most audio players automatically handle any station URLs. Some however support just a few formats, or can't handle modern XSPF playlists for instance. Which is why you can control this by adding a placeholder after the configured application name:

Placeholder

Alternatives

URL/Filename type

%pls

%url %u %r

Either a remote .pls resource (fastest), or a local .pls file (if converted)

%m3u

%f %g %m

Provides a local .m3u file for the streaming station

%srv

%d %s

Direct link to first streaming address, e.g. http://72.5.9.33:7500

%xspf

%x

Xiph.org shareable playlist format (for modern players)

%jspf

%j

JSON playlist format (widely unsupported)

%asx

Some obscure Windows playlist format (don't use that)

%smil

Standardized multimedia sequencing lists (which nobody uses either)

Preferrably use the long %abbr names for configuration. The default is %pls if you leave it out. (Most directories already provide PLS files, which avoids any extra conversion by ST2 which sometimes delay playback.)

A few channels (like Jamendo) send custom JSON playlist snippets, which no audio player would understand. Which is why they're always pre-converted.

Most audio players like %pls, yet sometimes the older %m3u format more. Streamripper requires %srv for recording.

Use the newer %xspf format if your player supports it. This format retains the maximum of station infos (such as homepages etc.), and thus often makes for better bookmarking directly in your player.

Other placeholders

In addition to stream URL + type placeholders (%r, %x, %pls, %m3u, etc), you can also pass row placeholders. These contain the stream information like title or bitrate, or any other internal field:

Placeholder

As variable

Field content

%title

$title

Station title

%genre

$genre

Stream category or genre list

%playing

$playing

Currently playing song, or geographic location

-

$url

Unfiltered stream url (may contain internal urn:xx:id)

%format

$format

The MIME type ("audio/mpeg")

%bitrate

$bitrate

Known stream bitrate, if any

%extra

$extra

Comments or timer settings

%favourite

$favourite

If bookmarked

Not all fields are used in all channels. Sometimes they're repurposed (like playing often doubles as Location: field). And some channels may even use custom internal names.

You often want to use such placeholders if you have a player or recording shell script, such as contrib/cmdline/streamripper_addgenre to handle them. Or if you define a mini-toolbar specbutton with custom commands.

Other players

Here a few other configuration examples for other players/backends.

MPD

Rocus van Oosten recommends following wrapper script to start playing radio streams via MPD right away:

MPD_HOST='10.0.0.222' # or your MPD host
export MPD_HOST
mpc clear
mpc load $1
mpc play

Save it as mpc-pls script and configure it in streamtuner as mpc-pls %pls for example. You can find an extended version in the contrib/cmdline/ directory.

Windows config

There's a few gothchas when running streamtuner2 on Windows.

  • You will often have to quote command paths (e.g. to "C:/Program Files/Mozilla Firefox/firefox.exe" or vlc.exe) in double quotes. In particular if those paths contain spaces.

  • If you're using streamripper.exe it's best to put it into a directory without spaces. For some reason quoting the full exe path will not pass on parameters.

  • If you want to be extra safe, just extend your system %PATH variable to include all relevant directories. Then just specify the basenames, like firefox.exe for browsing, or vlc.exe as player.

As reported by Oliver in the sourceforge Discussion board.