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 .
bentusis
Prole
Posts: 2 Joined: Wed May 30, 2012 3:50 pm
Post
by bentusis » Wed May 30, 2012 3:59 pm
Hi all,
I can't make the sound attenuation system work.
This is what I do :
Code: Select all
--Setting global sound options
love.audio.setPosition(400, 300, 0)
love.audio.setDistanceModel("exponent")
[...]
--Loading and playing the sound
self.idle_src = love.audio.newSource("res/tank/idle_loop.ogg", "static")
self.idle_src:setLooping(true)
self.idle_src:setDistance(10,100)
self.idle_src:setVolume(0.5)
self.idle_src:setRolloff(0)
self.idle_src:play()
[...]
--Updating sound source position
self.idle_src:setPosition(self.x, self.y, 0)
When I move my entity the volume remain the same.
Any idea ?
Thanks
Boolsheet
Inner party member
Posts: 780 Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland
Post
by Boolsheet » Wed May 30, 2012 5:01 pm
This is a moment where working code would help us to point out the problem. Like the
forum rules suggest, do attach a .love next time and all will better.
I'm guessing you are using a stereo source. Only mono sources will be positioned in the 3D space.
Shallow indentations.
bentusis
Prole
Posts: 2 Joined: Wed May 30, 2012 3:50 pm
Post
by bentusis » Wed May 30, 2012 5:33 pm
I posted the code relative to the sound. I didn't think you would need my whole project.
I found the problem btw, it comes from my sound file.
If I use the one supplied in TechnoCat example, it works flawlessly.
So do the sound file needs something special ?
Edit:
Didn't saw the second part of your message before posting.
Thanks for the help ! I'll try that.
Maybe this should be added to the wiki ?
Users browsing this forum: Ahrefs [Bot] , Google [Bot] and 5 guests