setVolume() question

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lbhoward
Prole
Posts: 23
Joined: Tue Feb 17, 2009 6:12 pm

setVolume() question

Post by lbhoward »

Hello again, I understand the usage of the love.audio.setVolume(0.5) command - however I am wondering if there is a way to set the volume for each individual sound played, let me explain.

I have defined 3 variables.

Code: Select all

music_vol = 1.0
voice_vol = 1.0
fx_vol = 1.0
And then defined my sounds.

Code: Select all

splashsong = love.audio.newMusic("sound/SFOpening.ogg")
love.audio.play(splashsong, 0)
What I'd like to do with this specific sound - is have it's volume the value of music_vol, from what I understand the command love.audio.setVolume affects all sounds playing, is there anyway to apply the value via something along the lines of

Code: Select all

splashsong:setVolume(music_vol)
I had a look through the documentation but nothing showed up, any help is much appreciated.
User avatar
Sslaxx
Citizen
Posts: 57
Joined: Sat Feb 14, 2009 8:54 pm
Location: Malvern, Worcs, UK
Contact:

Re: setVolume() question

Post by Sslaxx »

From what I understand, not right now. However, future versions will include per-channel pitch and volume control.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: setVolume() question

Post by bartbes »

It isn't implemented for music as of yet, it does for sounds, URL: http://love2d.org/docs/Sound_setVolume_1.html
lbhoward
Prole
Posts: 23
Joined: Tue Feb 17, 2009 6:12 pm

Re: setVolume() question

Post by lbhoward »

In that case I think I'll just incorporate a 'Master Volume' option, thank you very much for the info.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests