Hello ,
I run my audio file with the following code but volume does not change:
function \_M.playStream (name, params) if not loadedSounds[name] then loadedSounds[name] = audio.loadStream(sounds[name]) end audio.play(loadedSounds[name], { channel = params.channel, fadein = 1000, loops = params.loops or 0 }) \_M.setVolume( params.volume, { channel = params.channel } ) end
Volume function code:
function \_M.setVolume (volume, params) audio.setVolume( volume, { channel = params.channel } ) end
And in this case I used the function:
\_G.BackMusic = 50 sounds.playStream("backMusic", { channel = 1, volume = \_G.BackMusic / 100, loops = -1 }) sounds.setVolume(\_G.BackMusic / 100, { channel = 1 })
But the volume does not apply and the numbers will change nothing happens.
This problem is only in the stream.
please guide me.