HolyLib Wiki

IGModAudioChannelEncoder

IGModAudioChannelEncoder

Recently Added

This was recently added in version (0.8).

Metatable function Description
__tostring Returns a formated string of the IGModAudioChannelEncoder -> IGModAudioChannelEncoder [FileName/Format]
__index Used to find the functions on the metatable and access saved variables
__newindex Used to allow one to save variables on the object
__gc Internally deletes the encoder turning it invalid

Methods

boolean, string IGModAudioChannelEncoder:CastInit( string server, string password, string content, string name = nil, string url = nil, string genre = nil, string desc = nil, string headers = nil, number bitrate = 0, number flags = 0 )
Initializes sending the encoder's output to a Shoutcast or Icecast server.
See https://www.un4seen.com/doc/#bassenc/BASS_Encode_CastInit.html
This function requires the BASSENC plugin to work at all!
You can find all the plugins at https://www.un4seen.com/ drop them into the bin/ folder besides libbass.so
IGModAudioChannelEncoder:CastSetTitle( string title = nil, string url = nil )
Sets the title (and optionally the URL) of the current stream started with IGModAudioChannelEncoder:CastInit.
See https://www.un4seen.com/doc/#bassenc/BASS_Encode_CastSetTitle.html
boolean IGModAudioChannelEncoder:FeedData( string data )
Feeds the given PCM data into the encoder.
boolean IGModAudioChannelEncoder:FeedEmpty( number ms, number samplerate, number channels )
Feeds null data into the encoder for the given ms frame using the given samplerate and channels.
number IGModAudioChannelEncoder:GetState( )
Returns the current state of the encoder.
table IGModAudioChannelEncoder:GetTable( )
Returns the lua table used by newindex and index
boolean IGModAudioChannelEncoder:InsertVoiceData( VoiceData data )
Feeds the given voicedata into the encoder.
boolean IGModAudioChannelEncoder:IsValid( )
Returns true if the encoder is valid.
boolean, string IGModAudioChannelEncoder:ServerInit( string port, number buffer, number burst, number flags )
Sets up the encoder as a Shoutcast/Icecast source server, which listening clients can directly connect to.
See https://www.un4seen.com/doc/#bassenc/BASS_Encode_ServerInit.html
This function requires the BASSENC plugin to work at all!
You can find all the plugins at https://www.un4seen.com/ drop them into the bin/ folder besides libbass.so
boolean IGModAudioChannelEncoder:ServerKick( string client )
boolean, string IGModAudioChannelEncoder:SetChannel( IGModAudioChannel channel )
Changes the IGModAudioChannel that this encoder reads its data from.
IGModAudioChannelEncoder:SetPaused( boolean paused )
Pauses or resumes the encoder.
IGModAudioChannelEncoder:SetServerCallback( function callback )
Sets the callback that is called whenever a client connects to or disconnects from the server set up by IGModAudioChannelEncoder:ServerInit.
The callback is expected to return a boolean to allow/deny the connection, and optionally a string to send as extra HTTP headers when a client connects.
If no callback is set, all connections are allowed.