microsoft / microsoft/pxt-microbit
Strange async behavior for play sound on hardware
Open
@abchatra is already working on this.
Since Feb 24, 2022.
hardware
music
P2
v2hardware
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
If you call the synchronous play sound immediately after a call to the asynchronous play sound, the program waits for the first to complete but not the second. In this program:
When you press the B button, the icon shows after the first sound finishes instead of the second. This might be a DAL issue, but i'm not 100% sure
To Reproduce
Steps to reproduce the behavior:
- Download this program onto a microbit: https://makecode.microbit.org/_Az5FYmUtsDL9
- Press the A button, note the correct behavior
- Press the B button, note that the icon shows after the first (async) sound stops playing when it should only show after the second sound finishes
Expected behavior
Should wait until both sounds finish
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.