SlashCo Wiki

SlashCo.AudioSystem.CreateChannel

  SlashCo.AudioSystem.CreateChannel( string soundFile, string mode, function callback, function errorCallback = nil )

Description

Creates a new IGModAudioChannel using the given inputs

This is used internally - although you're able to use it you probably shouldn't.

This function accounts for and fixes the rare case that GMod's BASS fails to play a sound and errors with BASS_ERROR_FILEFORM
In this case it will write out the sound onto disk and play the disk file, as this issue is related to BASS somehow failing to load sounds from mounted content.

Arguments

1string soundFile

The soundFile to play

2string mode

The mode's to use, can be any of the flags from sound.PlayURL

3function callback

The callback function after creation

Function argument(s):
1IGModAudioChannel channel -

The created channel

2table channelData -

The channel data

Function return argument(s):

4function errorCallback = nil

The callback function if an error occured

Function argument(s):
1number errorCode -

The error code

2string errorName -

The error name

Function return argument(s):