package cry
Install
Dune Dependency
Authors
Maintainers
Sources
md5=03089949f9ffaeb8d26f71a2b3b78eed
sha512=01ebc48f5af4b319155ffcdc12205d7934e5c924653ee223b266463719865884aa0a0933b7d1ae9c4faea6aa0336a3d041ba1a5a04dbec17c2b4151d1969be4a
doc/cry/Cry/index.html
Module Cry
Source
Native implementation of the shout source protocols * for icecast and shoutcast.
Description
* * Cry
implements the protocols used to connect and send source data to * icecast2 and shoutcast servers. * * It is a low-level implementation that minimally manages source * connections. In particular, it does not handle synchronisation, unlike * the main implementation libshout. Hence, the task of sending audio data * to the streaming server at real time rate is left to the application.
Types and errors
Possible errors.
Optional ssl module
Register a transport module to be used for SSL connections.
Get a string explaining an error.
Possible verbs for HTTP streaming. Default: Source
Possible protocols. Icy
is the (undocumented) shoutcast source protocol. * Http
is the icecast2 source protocol. * Https
is the icecast2 source protocol with TLS connection. * * Ogg streaming is only possible with Http
. Any headerless format, * (e.g. mpeg containers), should work with both protocols, * provided you set the correct content-type (mime) for the source.
Special type for content-type (mime) data.
General mime type for ogg data.
Mime type for audio data encapsulated using ogg.
Mime type for video data encapsulated using ogg.
Mime type for mpeg audio data (mp3).
Create a mime type from a string (e.g. "audio/aacp")
Get the string representation of a mime type.
Type for a mount point. Icy_id
are for Shoutcast v2 * sid. For Shoutcast v1, use Icy_id 1
.
type connection = {
mount : mount;
user : string;
password : string;
host : string;
port : int;
chunked : bool;
content_type : content_type;
protocol : protocol;
headers : (string, string) Hashtbl.t;
}
Type for a source connection. * * headers
is a hash table containing the headers. * See connection
function for more details.
Returns a JSON string representation of a connection.
Type for audio informations. Used for connection headers. * See audio_info
function for more details.
Type for the status of a handler.
Type for the main handler.
API
Create a new handler. * * bind
is not used by default (system default). * timeout
is 30.
by default.
Get a handler's ICY capabilities. * For the Http
protocol, this is always true. * For the Icy
protocol, this is detected upon connecting.
Get data associated with a connection. Use it only if you know * what you are doing. * * Raises: Error Not_connected
if not connected.
val audio_info :
?samplerate:int ->
?channels:int ->
?quality:float ->
?bitrate:int ->
unit ->
audio_info
Create a new audio_info
value, * filed with given values.
val connection :
?user_agent:string ->
?name:string ->
?genre:string ->
?url:string ->
?public:bool ->
?audio_info:audio_info ->
?description:string ->
?host:string ->
?port:int ->
?chunked:bool ->
?password:string ->
?protocol:protocol ->
?user:string ->
mount:mount ->
content_type:content_type ->
unit ->
connection
Create a new connection
value * with default values. * * mount
is mandatory when using the Http
protocol. * icy_id
is mandatory to support multiple shoutcast sources * on shoutcast v2. * * host
is "localhost"
by default. * password
is "hackme"
by default. * user
is "source"
by default. Change user
only if you know * what your are doing. * protocol
is Http
by default. * port
is 8000
by default. * chunked
is false
by default and only works with HTTP/1.1-capable * servers. * * The list of preset headers for Http
connections is: * "User-Agent"
, "ice-name"
, "ice-genre"
, * "ice-url"
, "ice-public"
, "ice-audio-info"
, * "ice-description"
. * * The list of preset headers for Icy
connections is: * "User-Agent"
, "icy-name"
, "icy-url"
, "icy-pub"
, * "icy-genre"
, "icy-br"
. * * Additionally, you can also add: * "icy-irc"
, "icy-icq"
and "icy-aim"
but these are not added * by this function.
Connect a handler.
Update metadata on a handler. Useful only for non-ogg data format, * and if icy_cap
is true
for Icy
connections. * * For Icy
protocol, the relevant metadata are only "song"
* and "url"
. * * Raises: Error Not_connected
* if not connected.
val manual_update_metadata :
host:string ->
port:int ->
protocol:protocol ->
user:string ->
password:string ->
mount:mount ->
?connection_timeout:float ->
?timeout:float ->
?headers:(string, string) Hashtbl.t ->
?bind:string ->
?charset:string ->
metadata ->
unit
Manually update metadata on any source without necessarily * being connected to it for streaming. * * Optional timeout
is 30.
by default. * * Use it only if you know what you are doing !
Send data to a source connection. * * Raises: Error Not_connected
* if not connected.