Class: Shout

Class | Shout
In: | ext/shout.c
Parent: | Object

### Methods

agent agent= close connect connected? delay description description= disconnect dumpfile dumpfile= format format= genre genre= host host= metadata= mount mount= name name= new open pass pass= password password= port port= protocol protocol= public public= send sync url url= user user= user_agent user_agent= username username= version

### Constants

HTTP | = | INT2FIX(SHOUT_PROTOCOL_HTTP)
XAUDIOCAST | = | INT2FIX(SHOUT_PROTOCOL_XAUDIOCAST)
ICY | = | INT2FIX(SHOUT_PROTOCOL_ICY)
MP3 | = | INT2FIX(SHOUT_FORMAT_MP3)
OGG | = | INT2FIX(SHOUT_FORMAT_OGG)
VORBIS | = | INT2FIX(SHOUT_FORMAT_VORBIS)

### Public Class methods

new(...)

Make a new shout object. This method does not connect to any server. See connect.

version()

Returns the libshout version, as a string.

### Public Instance methods

agent()
agent=(p1)

Set the User-Agent reported. The default is "libshout/<libshout version>", e.g. "libshout/2.0.0".

close()

Disconnect from the server.

connect()

Connect to the server. You must set all the parameters you’re going to set before connecting.

connected?()

Returns true if connected, false otherwise, nil if something really crazy happened.

delay()

Return the proper amount of time, in milliseconds, before more data needs to be sent. This is for use when you would like to do something else in the intervening time period besides sleep.

description()
description=(p1)

Set a longer description of the stream. Probably several lines of text.

disconnect()

Disconnect from the server.

dumpfile()
dumpfile=(p1)

Set a filename where the server should dump the data from this stream. Only do this if you know what you are doing.

format()
format=(p1)

Set the format of the audio. Possible values are:

Shout::VORBIS
  Ogg Vorbis
Shout::MP3
  MP3

genre()
genre=(p1)

Set the ‘genre’ of the stream.

host()
host=(p1)

Set the hostname to connect to. The default is localhost.

metadata=(p1)

Set MP3 metadata. Create a ShoutMetadata object, add some stuff to it and pass it to this method. If the format of the stream isn’t MP3, and you try to set its metadata, an exception will most likely be raised.

mount()
mount=(p1)

Set the mountpoint on the server.

name()
name=(p1)

Set the name of the stream, e.g. "monkey’s radio tunes."

open()

Connect to the server. You must set all the parameters you’re going to set before connecting.

pass()
pass=(p1)

Set the password to authenticate with. The default is no password.

password()
password=(p1)

Set the password to authenticate with. The default is no password.

port()
port=(p1)

Set the destination port. The default is 8000.

protocol()
protocol=(p1)

Set the protocol to use when connecting. Default is Shout::HTTP. Possible values are:

Shout::HTTP
  HTTP; the protocol used by Icecast.
Shout::XAUDIOCAST
  XAudioCast. Obsolete.
Shout::ICY
  Icy. Obsolete. Used by Shoutcast.

public()
public=(p1)

Set whether or not this stream should be "public", i.e. advertised to a yp server such as yp.icecast.org. True or false. Nil counts as false.

send(p1)

Send some data. to_send is a String containing the data to send.

sync()

Sleep the necessary amount of time to play back the audio data sent since the last call to sync. After calling this, it’s time to send more data.

url()
url=(p1)

Set the URL to send the data to. Takes a string.

user()
user=(p1)

Set the user to authenticate as. The default is "source".

user_agent()
user_agent=(p1)

Set the User-Agent reported. The default is "libshout/<libshout version>", e.g. "libshout/2.0.0".

username()
username=(p1)

Set the user to authenticate as. The default is "source".

[Validate]