HolyLib Wiki

IGModAudioChannel

IGModAudioChannel

Metatable function Description
__tostring Returns a formated string of the IGModAudioChannel -> IGModAudioChannel [file name/url]
__gc Internally deletes the IGModAudioChannel turning it invalid

Methods

boolean IGModAudioChannel:AddMixerChannel( IGModAudioChannel otherChannel, number flags )
Adds the given channel into our mixer.
Binds internally to https://www.un4seen.com/doc/#bassmix/BASS_Mixer_StreamAddChannel.html
This function will throw an error if you call it on a non-mixer channel.
IGModAudioChannelEncoder, string IGModAudioChannel:CreateEncoder( string fileName, number bassFlags )
Creates a encoder and returns it, on failure it returns nil with the second return value containing the error reason
You can still provide a full filename into which the channel its bound to is slowly written
unlike IGModAudioChannel:EncodeToDisk this works on non-decode channels though it written bit by bit as the channel plays.
Valid encoders are:
  • wav (Requires BASSENC plugin)
  • aiff (Requires BASSENC plugin)
  • mp3 (Requires BASSENC_MP3 plugin)
  • ogg (Requires BASSENC_OGG plugin)
  • opus (Requires BASSENC_OPUS plugin)
  • flac (Requires BASSENC_FLAC plugin)
    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
IGModAudioChannel:CreateLink( IGModAudioChannel otherChannel )
Links the other channel to this channel one-way.
See https://www.un4seen.com/doc/#bass/BASS_ChannelSetLink.html (argument order is this, otherChannel)
IGModAudioChannel:Destroy()
Destroys the audio channel.
IGModAudioChannel:DestroyLink( IGModAudioChannel otherChannel )
Unlinks the other channel from this channel.
See https://www.un4seen.com/doc/#bass/BASS_ChannelRemoveLink.html (argument order is this, otherChannel)
boolean, string IGModAudioChannel:FeedData( string data )
Feeds the given PCM data into the channel.
This function will throw an error if you call it on a non-push channel.
boolean, string IGModAudioChannel:FeedEmpty( number ms, number samplerate, number channels )
Feeds null data into the channel for the given ms frame using the given samplerate and channels.
This function will throw an error if you call it on a non-push channel.
IGModAudioChannel:FFT( table output, number fft )
Computes the DFT of the sound channel.
What even is that.
IGModAudioChannel:Get3DCone()
Not implemented / throws a error when used.
IGModAudioChannel:Get3DEnabled()
Not implemented / throws a error when used.
IGModAudioChannel:Get3DFadeDistance()
Not implemented / throws a error when used.
number, string IGModAudioChannel:GetAttribute( number attribute )
Returns the channels attribute value.
See https://www.un4seen.com/doc/#bass/BASS_ChannelGetAttribute.html (all BASSATTRIB enums are exposed inside the bass. table)
number IGModAudioChannel:GetAverageBitRate( )
Returns the average bit rate.
number IGModAudioChannel:GetBitsPerSample( )
Returns the bits per sample.
number IGModAudioChannel:GetBufferedTime( )
Returns the buffered time of the channel. If it's playing a file, it will just return the length of it.
number, string IGModAudioChannel:GetChannelCount( )
Returns the number of channels this channel has.
string, string IGModAudioChannel:GetChannelData( number size )
Returns the given bytes of channel data - you cannot specify BASSDATA flags!
See https://www.un4seen.com/doc/#bass/BASS_ChannelGetData.html
number IGModAudioChannel:GetChannelPan( )
Returns the channel pan.
string IGModAudioChannel:GetFileName( )
Returns the filename or URL the channel is playing.
number, number IGModAudioChannel:GetLevel( )
Returns the level of the channel. First value is left, second is right.
number, string IGModAudioChannel:GetMixerChannelCount( )
Returns the number of channels the mixer channel that this channel is attached to has.
number IGModAudioChannel:GetMixerState( )
Returns how a mixer would see the channels current state which could differ when buffering
See https://www.un4seen.com/doc/#bassmix/BASS_Mixer_ChannelIsActive.html for more details
number IGModAudioChannel:GetPlaybackRate( )
Returns the playback rate of the channel.
IGModAudioChannel:GetPos()
Not implemented / throws a error when used.
number IGModAudioChannel:GetSampleRate( )
Returns the samplerate of the channel.
number IGModAudioChannel:GetState( )
Returns the state of the channel.
table IGModAudioChannel:GetTable( )
Returns the lua table used by newindex and index
string IGModAudioChannel:GetTags( )
Returns the tag of the channel.
number IGModAudioChannel:GetTime( )
Returns the time of the channel.
boolean, string IGModAudioChannel:InsertVoiceData( VoiceData data )
Feeds the given voicedata into the channel.
This function will throw an error if you call it on a non-push channel.
boolean IGModAudioChannel:Is3D( )
Returns true if the channel is a 3D one.
boolean IGModAudioChannel:IsAttributeSliding( number attribute )
Returns true if the given attribute is actively sliding to a value over time.
See https://www.un4seen.com/doc/#bass/BASS_ChannelIsSliding.html (all BASSATTRIB enums are exposed inside the bass. table)
boolean IGModAudioChannel:IsBlockStreamed( )
Returns true if the sound is received in chunks.
boolean IGModAudioChannel:IsLooping( )
Returns true if the channel will loop.
boolean IGModAudioChannel:IsMixer( )
Returns true if the channel was created using bass.CreateMixerChannel
boolean IGModAudioChannel:IsOnline( )
Returns true if were playing a URL.
boolean IGModAudioChannel:IsSplitter( )
Returns true if the channel was created using bass.CreateSplitChannel
boolean IGModAudioChannel:IsValid( )
Returns true if the channel is valid.
IGModAudioChannel:Pause()
Pauses the channel.
IGModAudioChannel:Play()
Plays the channel.
boolean IGModAudioChannel:RemoveFX( string fxName )
Removes the given FX from the channel
See https://www.un4seen.com/doc/#bass/BASS_FXReset.html
IGModAudioChannel:RemoveMixerChannel()
Removes any mixer this channel might have been added to
Binds internally to https://www.un4seen.com/doc/#bassmix/BASS_Mixer_ChannelRemove.html
boolean IGModAudioChannel:ResetFX( string fxName )
boolean IGModAudioChannel:ResetSplitStream( )
Resets the split channel.
Binds internally to https://www.un4seen.com/doc/#bassmix/BASS_Split_StreamReset.html
IGModAudioChannel:Restart()
Restarts the channel.
IGModAudioChannel:Set3DCone()
Not implemented / throws a error when used.
IGModAudioChannel:Set3DEnabled()
Not implemented / throws a error when used.
IGModAudioChannel:Set3DFadeDistance()
Not implemented / throws a error when used.
boolean, string IGModAudioChannel:SetAttribute( number attribute, number value )
Sets a channel attribute to the given value.
See https://www.un4seen.com/doc/#bass/BASS_ChannelSetAttribute.html
(all BASS_ATTRIB_ enums are exposed inside the bass. table)
IGModAudioChannel:SetChannelPan( number pan )
Sets the channel pan.
boolean, string IGModAudioChannel:SetFX( string fxName, number fxType, number priority, table fxParams )
Sets the given FX type onto the channel, use the exposed bass.FX_ enums for fxType.
See https://www.un4seen.com/doc/#bass/BASS_ChannelSetFX.html for more details
IGModAudioChannel:SetLooping( boolean looping )
Sets looping for the channel.
boolean, string IGModAudioChannel:SetMixerMatrix( table matrix, number time = 0 )
Sets the channel's mixer matrix. See https://www.un4seen.com/doc/#bassmix/BASS_Mixer_ChannelIsActive.html for more details
IGModAudioChannel:SetPos()
Not implemented / throws a error when used.
boolean, string IGModAudioChannel:SetSlideAttribute( number attribute, number value, number time )
Sets a channel attribute to the given value over a specific time.
See https://www.un4seen.com/doc/#bass/BASS_ChannelSlideAttribute.html
(all BASS_ATTRIB_ enums are exposed inside the bass. table)
IGModAudioChannel:SetTime( number time )
Sets the time of the channel.
IGModAudioChannel:SetVolume( number playbackRate )
Sets the volume of the channel. It's serverside... how does volume even play a role
IGModAudioChannel:Stop()
Stops the channel.
IGModAudioChannel:Update( number time )
Updates the channel for the given time in seconds
See: https://www.un4seen.com/doc/#bass/BASS_ChannelUpdate.html
boolean, string IGModAudioChannel:WriteToDisk( string fileName, number bassFlags, function callback, boolean async = false )
Writes the channel into a file always using the DATA gamePath, the encoder internally used depends on the filename.
Valid encoders for file extension are:
  • .wav (Requires BASSENC plugin)
  • .aiff (Requires BASSENC plugin)
  • .mp3 (Requires BASSENC_MP3 plugin)
  • .ogg (Requires BASSENC_OGG plugin)
  • .opus (Requires BASSENC_OPUS plugin)
  • .flac (Requires BASSENC_FLAC plugin)
    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
    This function only works on decode channels, a channel needs to have decode set as a flag when being created