microsoft / pxt-adafruit

Microsoft MakeCode editor for Adafruit Circuit Playground Express
https://makecode.adafruit.com
Other
81 stars 77 forks source link

Stop sound problems #989

Closed jedgarpark closed 5 years ago

jedgarpark commented 5 years ago

New "stop sound (ba ding)" block doesn't seem to work as expected, or as the previous "stop all sounds" block does. I'm starting a sound with button a, trying to stop it with button b. New block version:

input.buttonA.onEvent(ButtonEvent.Click, function () {
    music.playSound(music.sounds(Sounds.PowerDown))
})
input.buttonB.onEvent(ButtonEvent.Click, function () {
    music.powerDown.stop()
})

Older block version, which does allow the b button to stop the sound:

input.buttonA.onEvent(ButtonEvent.Click, function () {
    music.playSound(music.sounds(Sounds.PowerDown))
})
input.buttonB.onEvent(ButtonEvent.Click, function () {
    music.stopAllSounds()
})
pelikhan commented 5 years ago

Stop all sounds block is back. It will stop melodies but any "playTone" will continue running to completion.