Type Function
Library audio.*
Return value Number
Revision Current Public Release (2017.3068)
Keywords audio, channels, free channels
See also


Looks for an available audio channel for playback. You can provide a start channel number as parameter and begin searching from that channel, increasing upward to the highest channel. The search does not include reserved channels.

This function returns the channel number of an available channel or 0 if none could be found.


audio.findFreeChannel( [ startChannel ] )
startChannel (optional)

Number. The channel number you want to start looking at. Search will increase upwards from this channel. 0 or no parameter begins searching at the lowest possible value.


local availableChannel = audio.findFreeChannel() laserSound, { channel=availableChannel } )