Hi, all.
How can I manage the volume of my game music separated from the volume of my game sfx?
Thanks. [import]uid: 162818 topic_id: 36885 reply_id: 336885[/import]
Hi, all.
How can I manage the volume of my game music separated from the volume of my game sfx?
Thanks. [import]uid: 162818 topic_id: 36885 reply_id: 336885[/import]
Hi there,
You can reserve a specific audio channel for your music using audio.reserveChannels (http://docs.coronalabs.com/api/library/audio/reserveChannels.html), and set its volume separately from the volume of the other channels, which you can use for sound effects.
Hope this helps.
Yeah! That’s what I need! Thank you, From-aukStudios-dude. [import]uid: 162818 topic_id: 36885 reply_id: 145136[/import]
Hi there,
You can reserve a specific audio channel for your music using audio.reserveChannels (http://docs.coronalabs.com/api/library/audio/reserveChannels.html), and set its volume separately from the volume of the other channels, which you can use for sound effects.
Hope this helps.
Yeah! That’s what I need! Thank you, From-aukStudios-dude. [import]uid: 162818 topic_id: 36885 reply_id: 145136[/import]
Hi there,
You can reserve a specific audio channel for your music using audio.reserveChannels (http://docs.coronalabs.com/api/library/audio/reserveChannels.html), and set its volume separately from the volume of the other channels, which you can use for sound effects.
Hope this helps.
Yeah! That’s what I need! Thank you, From-aukStudios-dude. [import]uid: 162818 topic_id: 36885 reply_id: 145136[/import]
Hi again, aukStudios. I’m getting a problem. I can’t set specific sounds to the channels I’ve reserved.
What shall I do? [import]uid: 162818 topic_id: 36885 reply_id: 145492[/import]
Hi there,
When you call [lua]audio.play()[/lua], are you including the channel that you want the sound or music to play on? You could do it like this:
[blockcode]
local myMusic = audio.loadStream(“myMusicFile.mp3”)
local mySound = audio.loadSound(“mySoundFile.wav”)
audio.reserveChannels(2)
local myMusicChannel = 1
local mySoundChannel = 2
audio.setVolume( 0.15, { channel=myMusicChannel } ) – Soft music
audio.setVolume( 1, { channel=mySoundChannel } ) – Loud sound effects
audio.play( myMusic, { channel=myMusicChannel } )
audio.play( mySound, { channel=mySoundChannel } )
[/blockcode]
Ahhh! That’s it!
I was setting the sound to channel like this:
[lua] audio.loadSound(“blabs.ogg”, {channel = 1})[/lua]
Thanks you once more, dude! [import]uid: 162818 topic_id: 36885 reply_id: 145495[/import]
Hi there,
You can reserve a specific audio channel for your music using audio.reserveChannels (http://docs.coronalabs.com/api/library/audio/reserveChannels.html), and set its volume separately from the volume of the other channels, which you can use for sound effects.
Hope this helps.
Yeah! That’s what I need! Thank you, From-aukStudios-dude. [import]uid: 162818 topic_id: 36885 reply_id: 145136[/import]
Hi again, aukStudios. I’m getting a problem. I can’t set specific sounds to the channels I’ve reserved.
What shall I do? [import]uid: 162818 topic_id: 36885 reply_id: 145492[/import]
Hi there,
When you call [lua]audio.play()[/lua], are you including the channel that you want the sound or music to play on? You could do it like this:
[blockcode]
local myMusic = audio.loadStream(“myMusicFile.mp3”)
local mySound = audio.loadSound(“mySoundFile.wav”)
audio.reserveChannels(2)
local myMusicChannel = 1
local mySoundChannel = 2
audio.setVolume( 0.15, { channel=myMusicChannel } ) – Soft music
audio.setVolume( 1, { channel=mySoundChannel } ) – Loud sound effects
audio.play( myMusic, { channel=myMusicChannel } )
audio.play( mySound, { channel=mySoundChannel } )
[/blockcode]
Ahhh! That’s it!
I was setting the sound to channel like this:
[lua] audio.loadSound(“blabs.ogg”, {channel = 1})[/lua]
Thanks you once more, dude! [import]uid: 162818 topic_id: 36885 reply_id: 145495[/import]