August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)

Kamaelia.Protocol.HTTP.IcecastClient

Icecast/SHOUTcast MP3 streaming client

This component uses HTTP to stream MP3 audio from a SHOUTcast/Icecast server.

IcecastClient fetches the combined audio and metadata stream from the HTTP server hosting the stream. IcecastDemux separates the audio data from the metadata in stream and IcecastStreamWriter writes the audio data to disk (discarding metadata).

Example Usage

Receive an Icecast/SHOUTcast stream, demultiplex it, and write it to a file:

pipeline(
    IcecastClient("http://64.236.34.97:80/stream/1049"),
    IcecastDemux(),
    IcecastStreamWriter("stream.mp3"),
).run()

How does it work?

The SHOUTcast/Icecast protocol is virtually identical to HTTP. As such, IcecastClient subclasses SingleShotHTTPClient modifying the request slightly to ask for stream metadata(e.g. track name) to be included (by adding the icy-metadata header). It is otherwise identical to its parent class.


Kamaelia.Protocol.HTTP.IcecastClient.IcecastClient

class IcecastClient(SingleShotHTTPClient)

IcecastClient(starturl) -> Icecast/SHOUTcast MP3 streaming component

Arguments: - starturl -- the URL of the stream

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

formRequest(self, url)

Overrides the standard HTTP request with an Icecast/SHOUTcast variant which includes the icy-metadata header required to get metadata with the stream

main(self)

Kamaelia.Protocol.HTTP.IcecastClient.IcecastDemux

class IcecastDemux(Axon.Component.component)

Splits a raw Icecast stream into A/V data and metadata

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

dictizeMetadata(self, metadata)

Convert metadata that was embedded in the stream into a dictionary.

main(self)

Kamaelia.Protocol.HTTP.IcecastClient.IcecastStreamRemoveMetadata

prefab: IcecastStreamRemoveMetadata

Kamaelia.Protocol.HTTP.IcecastClient.IcecastStreamWriter

class IcecastStreamWriter(Axon.Component.component)

Inboxes

  • control : UNUSED
  • inbox : Icecast stream

Outboxes

  • outbox : UNUSED
  • signal : UNUSED

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, filename)

main(self)

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT