Hello everyone,
I noticed some weird behavior with the audio library.
In the audio api there are two different functions to load an audio file, loadSound and loadStream. On windows, both work fine if used alone, but there seems to be a problem if I load and play more than one type of sound (using different file sources). If I play a sound loaded with loadSound on a given channel, it seems that channel will no longer play a “stream” sound.
For instance, the following code fails at playing the music
local sfx = audio.loadSound("sound.ogg") local stream = audio.loadStream("music.ogg") audio.play(sfx) audio.play(stream)
but if I play the stream audio first it works
local sfx = audio.loadSound("sound.ogg") local stream = audio.loadStream("music.ogg") audio.play(stream) audio.play(sfx)
or if I specify a channel that was not yet play by the “sfx”:
local sfx = audio.loadSound("sound.ogg") local stream = audio.loadStream("music.ogg") audio.play(sfx) audio.play(stream, { channel = 2 })