Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound\Music on channel is stopped condition return true before it is begin to play #1299

Closed
ddabrahim opened this issue Nov 24, 2019 · 2 comments

Comments

@ddabrahim
Copy link
Contributor

Describe the bug

When we play a sound or music on a channel and immediately after we want to check if the Sound or the Music on the channel is stopped then do something, the condition return true and fire the actions even before the sound and music actually begin to play.

I think what is happening is that, at the very first few frames when the sound and music file is still loading and nothing is playing, the condition may think “hey nothing is playing so it must be stopped” and the condition return true.

If this is the case,I think it is a not optimal behaviour.
The problem is that it makes the condition completely useless on it own and require additional conditions like a timer for example to wait 1 second before checking if the audio or music is stopped to make it actually work.

What I would expect to happen, the condition should wait for a sound and music to actually being played on the specified channel and then wait for it to stop on the specified channel.
If there is any error and the sound and music can not be loaded and played, then it should never return true, because it is never played and there was nothing to stop and so the condition “Sound\Music on channel is Stopped” should never be true in my opinion.

Forum:
https://forum.gdevelop-app.com/t/bug-sound-music-on-channel-is-stopped-condition-return-true-before-it-is-begin-to-play/21487

To Reproduce

Steps to reproduce the behavior:

  1. play audio on a channel
  2. use the event is audio is stopped on the channel do something

Other details

GDevelop 5 beta83 Desktop
Windows 10 64bit

@4ian
Copy link
Owner

4ian commented Dec 1, 2019

Thanks for the example, very useful! I've fixed that for next version (cd32e51).

Precisely, calling the action to play the sound or music will immediately consider the sound/music as being playing - even if loading. So you can immediately use the action to check if the sound/music is stopped.
It will be stopped when 1) finished, 2) you stopped it with another action or 3) an error happened during loading.

I've just written about this in the last section of http://wiki.compilgames.net/doku.php/gdevelop5/all-features/audio

@4ian 4ian closed this as completed Dec 1, 2019
@ddabrahim
Copy link
Contributor Author

Thank you! It is very much appreciated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants