Sound not playing

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

Sound not playing

Post by Anxiety » Sun Apr 10, 2011 1:30 pm

Im making a shooting game with sounds (of course, duh). But when i do "love.audio.play(sound)", the sound wont play everytime. I hav tried "sound:play()" but still it doesnt play everytime. In case you didnt get the question, how can i make the sound play everytime?
I can't come up with a good signature!

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

Re: Sound not playing

Post by Robin » Sun Apr 10, 2011 2:04 pm

Have you tried rewinding it with Source:rewind it before playing?
Help us help you: attach a .love.

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

Re: Sound not playing

Post by Anxiety » Sun Apr 10, 2011 2:53 pm

nope.avi
I can't come up with a good signature!

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

Re: Sound not playing

Post by Anxiety » Sun Apr 10, 2011 2:57 pm

Still doesnt play.
I can't come up with a good signature!

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

Re: Sound not playing

Post by Robin » Sun Apr 10, 2011 3:03 pm

Could you give us a .love?
Help us help you: attach a .love.

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

Re: Sound not playing

Post by Anxiety » Sun Apr 10, 2011 3:58 pm

.love?
I can't come up with a good signature!

User avatar
Lafolie
Inner party member
Posts: 804
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Sound not playing

Post by Lafolie » Sun Apr 10, 2011 4:06 pm

Your source code....

EDIT: Also, you should reaaallly read up on the wiki. http://love2d.org/wiki/Game_Distribution
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

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

Re: Sound not playing

Post by Anxiety » Sun Apr 10, 2011 4:13 pm

If you mean how i do it;

shot_sound = love.audio.newSource("glock18.wav", "static")

and when fired;

shot_sound:rewind()
shot_sound:play()

And still doesnt work.
I can't come up with a good signature!

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

Re: Sound not playing

Post by Robin » Sun Apr 10, 2011 4:22 pm

I meant your whole source code. Attaching a .love to your post is often done, because it allows us to run the game and see with our own eyes what the problem is, and then dig into the source. This is because the problem is not always where you think it is.

The snippet above is pretty much useless to us, for example.

If you upload a .love of your game to the forums, we can help you better.
Help us help you: attach a .love.

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

Re: Sound not playing

Post by Anxiety » Sun Apr 10, 2011 4:58 pm

Here :)
Attachments
Total Shootout.love
(55.5 KiB) Downloaded 98 times
I can't come up with a good signature!

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests