## Sound not playing

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

### Re: Sound not playing

Anyone? I really want for it to work (who doesnt?).
I can't come up with a good signature!

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Sound not playing

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.

Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

### Re: Sound not playing

Aww D:
I can't come up with a good signature!

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: Sound not playing

Code: Select all

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

Taehl
Dreaming in associative arrays
Posts: 1024
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

### Re: Sound not playing

Use TEsound and worry no more.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.

EmmanuelOga
Citizen
Posts: 56
Joined: Thu Apr 22, 2010 9:42 pm
Location: Buenos Aires, Argentina
Contact:

### Re: Sound not playing

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

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