Feature Request: Identify if specific sounds and/or music is currently playing
Closed this issue · 0 comments
aparmar2000 commented
Brief summary of issue / Description of requested feature:
When programmatically playing sounds it is very useful to have some way(s) of identifying what is actually currently playing. It would be quite helpful if features to facilitate this could be added.
Steps to reproduce the issue / Reasons for adding feature:
Currently, as far as I can tell, there is no way to tell that (a) a sound/music track is currently playing or to even (b) tell if a playSoundFile
call has actually started the playback of the media file. (a) is very helpful to avoid overlapping sounds, and (b) can also help avoid overlapping sounds and provides a way to know if a sound was not played due to, say, its priority
.
Error output / Expected result of feature
isSoundPlaying
andisMusicPlaying
functions are added that accepts the same filters asstopSounds
/stopMusic
and return the number of currently playing media files of that category that match those filters. (Or, alternatively, a simple boolean indicating if any matching media files are playing. Another option is to haveplaySoundFile
return an id that can be used withisActive
.)playSoundFile
returns different values depending on whether or not the sound was actually started.