aboutsummaryrefslogtreecommitdiff

csound-shout : Broadcasting to Shoutcast and Icecast servers from within Csound

Overview

csound-shout enables simple connection to a Shoutcast or Icecast server (or anything else supporting the shout protocol), and streaming audio to the server from within Csound. Audio is encoded as VBR MP3, and various stream descriptors/metadata may be set.

Requirements

  • Cmake >= 2.8.12
  • Csound with development headers >= 6.14.0
  • libshout

Installation

Create a build directory at the top of the source tree, execute cmake .., make and optionally make install as root. If the latter is not used/possible then the resulting library can be used with the --opcode-lib flag in Csound. eg:

mkdir build && cd build
cmake ..
make && sudo make install

Cmake should find Csound and any other required libraries using the modules in the cmake/Modules directory and installation should be as simple as above.

Examples

Some examples are provided in the examples directory.

Opcode reference

ishout shoutinit Shost, iport, Suser, Spassword, Smount

Define a connection to a Shoutcast or Icecast server.

  • ishout : the connection handle to be used by all subsequent opcodes

  • Shost : server hostname or IP address

  • iport : server port
  • Suser : username; may be an empty string if not required
  • Spassword : password; may be an empty string if not required
  • Smount : mount point; may be an empty string if not required

shoutopen ishout

Open a connection defined by shoutinit.

  • ishout : the connection handle created by shoutinit

shoutclose ishout

Close a connection to a server.

  • ishout : the connection handle created by shoutinit

shoutsetname ishout, Sname

Set the name of the stream to be displayed in the server directory. Must be called on a connection before being opened with shoutopen.

  • ishout : the connection handle created by shoutinit

  • Sname : name of the stream to be displayed

shoutseturl ishout, Surl

Set the URL of the stream to be displayed in the server directory. Must be called on a connection before being opened with shoutopen.

  • ishout : the connection handle created by shoutinit

  • Surl : URL to be displayed

shoutsetgenre ishout, Sgenre

Set the genre of the stream to be displayed in the server directory. Must be called on a connection before being opened with shoutopen.

  • ishout : the connection handle created by shoutinit

  • Sgenre : genre to be displayed

shoutsetdescription ishout, Sdescription

Set the description of the stream to be displayed in the server directory. Must be called on a connection before being opened with shoutopen.

  • ishout : the connection handle created by shoutinit

  • Sdescription : description to be displayed

shoutsetpublic ishout, ipublic

Set whether the stream is to be displayed in the server directory. Must be called on a connection before being opened with shoutopen.

  • ishout : the connection handle created by shoutinit

  • ipublic : 1 = public , 0 = private

shoutsetmeta ishout, Skey, Svalue

Set arbitrary metadata for the current track. Must be called on a connection after being opened with shoutopen. Currently "song" and "url" as Skey are known values to work with servers.

  • ishout : the connection handle created by shoutinit

  • Skey : metadata key

  • Svalue : metadata value

shoutsend ishout, aleft, aright [, iquality=4]

Stream audio data to the server. It will be encoded as VBR MP3 using LAME with the quality set to iquality.

  • ishout : the connection handle created by shoutinit

  • aleft : left audio channel

  • aright : right audio channel
  • iquality : LAME VBR quality, defaults to 4