Page 2 of 2

Re: Sound not playing

Posted: Sun Apr 10, 2011 5:38 pm
by Anxiety
Anyone? I really want for it to work (who doesnt?).

Re: Sound not playing

Posted: Sun Apr 10, 2011 5:51 pm
by Robin
Thanks for the .love. Also, don't worry if no-one replied for a few hours. This is still a forum. Plus, it was around dinner time for most of us.

I looked at it but couldn't find the exact cause. :( Maybe someone else can help.

Re: Sound not playing

Posted: Sun Apr 10, 2011 5:52 pm
by Anxiety
Aww D:

Re: Sound not playing

Posted: Sun Apr 10, 2011 5:55 pm
by TechnoCat
do this instead

Code: Select all

Source:stop()
Source:play()
You might not be able to rewind statics.

Re: Sound not playing

Posted: Sun Apr 10, 2011 7:56 pm
by Taehl
Use TEsound and worry no more.

Re: Sound not playing

Posted: Wed Apr 13, 2011 11:37 pm
by EmmanuelOga
The easiest is create the source each time you want to play it. Otherwise you need to checkout if the sound is playing, if it is, create a new source for the source file, in order to get the same sound to play more than once, etc...

Code: Select all

function shot_sound()
	love.audio.newSource("sound/glock18.wav", "static"):play()
end

function reload1()
	love.audio.newSource("sound/glock_clipin.wav", "static"):play()
end

function reload2()
	love.audio.newSource("sound/glock_clipout.wav", "static"):play()
end
you can call those methods each time you want to play. Garbage collection should take care of the rest.
shoot.love
shoot!
(51.17 KiB) Downloaded 155 times