How do I check if a audio source is playing or not?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
GalacticPixelStudios
Prole
Posts: 7
Joined: Sun Nov 25, 2012 4:19 am

How do I check if a audio source is playing or not?

Post by GalacticPixelStudios »

I've rummaged through the wiki. I've searched through the forums.
I still don't have any solid information of how to check whether a sound is playing.

I need some sort of boolean that will return true or false in accordance to a sound being played or not.

I've been trying to use "Source:isPlaying" only to have it return as the error: attempt to call method 'isPlaying' (a nil value)


I'll accept any tutorial links with relevance! :)
-GalacticPixelStudios
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: How do I check if a audio source is playing or not?

Post by raidho36 »

So I suppose you've checked the wiki, but not carefully enough. That's because there's no "isPlaying". There's only "isPaused" and "isStopped". If sound is not stopped and is not paused, then it's played, by definition.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: How do I check if a audio source is playing or not?

Post by jjmafiae »

the isPlaying will first arrive in 0.9.0 make sure to read before posting and this is also the wrong forum (post in support & dev)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 7 guests