Type IGModAudioChannel
IGModAudioChannel
Methods
| enableLooping( enable ) | Enables/disables looping. |
| fft( output, type ) | Outputs FFT data to the Output table. |
| get3DCone() | Gets the 3D cone paramters for the sound. |
| get3DFadeDistance() | Gets the 3D fade distance for the sound. |
| getAverageBitRate() | Gets the current average bit rate of the sound. |
| getBitsPerSample() | Gets the bits per sample for the file. |
| getFileName() | Gets the file name of the sound. |
| getLength() | Gets the length of the sound. |
| getLevel() | Gets the level of the sound for the left and right channels. |
| getPan() | Gets the current panning of the channel. |
| getPlaybackRate() | Gets the playback rate of the sound. |
| getPos() | Gets the position of the sound. |
| getSamplingRate() | Gets the sampling rate of the sound in MHz. |
| getState() | Gets the state of the sound as an enum. |
| getTime() | Gets the current time the sound is at. |
| getVolume() | Gets the current volume of the sound. |
| is3D() | Returns whether the sound is 3D. |
| isBlockStreamed() | Returns whether the sound is block streamed. |
| isLooping() | Returns whether the sound is looping. |
| isValid() | Returns whether the sound channel is valid for use. |
| pause() | Pauses the sound playback. |
| play() | Resumes or starts the sound playback depending on if it was paused or stopped. |
| set3DCone( innerAng, outerAng, outerVolume ) | Sets the 3D cone for the sound. |
| set3DEnabled( enabled ) | Sets whether 3D playback is enabled. |
| set3DFadeDistance( min, max ) | Sets the 3D fade distance for the sound. |
| setPan( panning ) | Sets the panning of the channel. |
| setPlaybackRate( rate ) | Sets the playback rate for the sound. |
| setPos( pos, dir ) | Sets the position of the sound. |
| setTime( time ) | Sets the time of the sound. |
| setVolume( volume ) | Sets the volume of the sound. |
| stop() | Stops the sound from playing, next time you call :play() it will restart from the beginning. |
Methods
- IGModAudioChannel:enableLooping( enable )
-
Enables/disables looping. Only works on noblock channels.
Environment:
ClientParameters:
-
enable: Should looping be enabled?
-
- IGModAudioChannel:fft( output, type )
-
Outputs FFT data to the Output table.
Environment:
ClientParameters:
-
output: The table to place the FFT data into. -
type: The type of FFT data to put into it. One of the sounds.FFT_* enums.
Return value:
(number)The number of levels put into the table. -
- IGModAudioChannel:get3DCone()
-
Gets the 3D cone paramters for the sound.
Environment:
ClientReturn value:
(number)Inner angle, outer angle and outer volume. - IGModAudioChannel:get3DFadeDistance()
-
Gets the 3D fade distance for the sound.
Environment:
ClientReturn value:
(number)Min distance, max distance. - IGModAudioChannel:getAverageBitRate()
-
Gets the current average bit rate of the sound.
Environment:
ClientReturn value:
(number)Bit rate. - IGModAudioChannel:getBitsPerSample()
-
Gets the bits per sample for the file. Does not work for mp3 or ogg files.
Environment:
ClientReturn value:
(number)Bits per sample. - IGModAudioChannel:getFileName()
-
Gets the file name of the sound.
Environment:
ClientReturn value:
(string)File name. - IGModAudioChannel:getLength()
-
Gets the length of the sound.
Environment:
ClientReturn value:
(number)Length of the sound. - IGModAudioChannel:getLevel()
-
Gets the level of the sound for the left and right channels. Values are between 0 and 1.
Environment:
ClientReturn values:
-
(number)Left sound level. -
(number)Right sound level.
-
- IGModAudioChannel:getPan()
-
Gets the current panning of the channel.
Environment:
ClientReturn value:
(number)The panning of the channel, with -1 being left, 0 centre, and 1 right. - IGModAudioChannel:getPlaybackRate()
-
Gets the playback rate of the sound.
Environment:
ClientReturn value:
(number)Playback rate, 1 is normal speed. - IGModAudioChannel:getPos()
-
Gets the position of the sound.
Environment:
ClientReturn value:
(Vector)Position vector of the sound. - IGModAudioChannel:getSamplingRate()
-
Gets the sampling rate of the sound in MHz. Should always be 44100.
Environment:
ClientReturn value:
(number)Sampling rate. - IGModAudioChannel:getState()
-
Gets the state of the sound as an enum.
Environment:
ClientReturn value:
(number)State enum (one of sounds.GMOD_CHANNEL_*). - IGModAudioChannel:getTime()
-
Gets the current time the sound is at.
Environment:
ClientReturn value:
(number)Current time of the sound. - IGModAudioChannel:getVolume()
-
Gets the current volume of the sound. Value is between 0 and 1.
Environment:
ClientReturn value:
(number)Volume. - IGModAudioChannel:is3D()
-
Returns whether the sound is 3D.
Environment:
ClientReturn value:
(boolean)True if 3D, false otherwise. - IGModAudioChannel:isBlockStreamed()
-
Returns whether the sound is block streamed.
Environment:
ClientReturn value:
(boolean)True if block streamed, false otherwise. - IGModAudioChannel:isLooping()
-
Returns whether the sound is looping.
Environment:
ClientReturn value:
(boolean)True if looping, false otherwise. - IGModAudioChannel:isValid()
-
Returns whether the sound channel is valid for use.
Environment:
ClientReturn value:
(boolean)True if valid, false otherwise. - IGModAudioChannel:pause()
-
Pauses the sound playback.
Environment:
Client - IGModAudioChannel:play()
-
Resumes or starts the sound playback depending on if it was paused or stopped.
Environment:
Client - IGModAudioChannel:set3DCone( innerAng, outerAng, outerVolume )
-
Sets the 3D cone for the sound. For all parameters, -1 leaves it at its current value.
Environment:
ClientParameters:
-
innerAng: The inner angle. Range is 0 (no cone) to 360 (sphere). -
outerAng: The outer angle. Range is 0 (no cone) to 360 (sphere). -
outerVolume: The volume outside the projection cone. Range is 0 (silent) to 1 (same as inside cone).
-
- IGModAudioChannel:set3DEnabled( enabled )
-
Sets whether 3D playback is enabled.
Environment:
ClientParameters:
-
enabled: Whether 3D playback should be enabled or not.
-
- IGModAudioChannel:set3DFadeDistance( min, max )
-
Sets the 3D fade distance for the sound.
Environment:
ClientParameters:
-
min: Min distance from the sound to start fading. -
max: Past this distance the sound stops fading.
-
- IGModAudioChannel:setPan( panning )
-
Sets the panning of the channel.
Environment:
ClientParameters:
-
panning: The panning to use as a number, with -1 being left, 0 centre, and 1 right.
-
- IGModAudioChannel:setPlaybackRate( rate )
-
Sets the playback rate for the sound.
Environment:
ClientParameters:
-
rate: Playback rate, 1 is normal speed, 0.5 is half speed etc.
-
- IGModAudioChannel:setPos( pos, dir )
-
Sets the position of the sound.
Environment:
ClientParameters:
-
pos: The position in the world to place the sound. -
dir: Optional direction to play the sound towards. Leave nil to have no direction.
-
- IGModAudioChannel:setTime( time )
-
Sets the time of the sound. You must have set 'noblock' in the flags for the sound.
Environment:
ClientParameters:
-
time: The time in the sound to jump to.
-
- IGModAudioChannel:setVolume( volume )
-
Sets the volume of the sound.
Environment:
ClientParameters:
-
volume: The volume to set, value is a multiplier (0 = muted, 1 = 100%, 2 = 200% etc.)
-
- IGModAudioChannel:stop()
-
Stops the sound from playing, next time you call :play() it will restart from the beginning.
Environment:
Client