This commit is contained in:
Caitlin Hennessy 2017-12-14 09:17:47 -08:00
parent 2d81be3b24
commit cb648019bb
3 changed files with 8 additions and 3 deletions

View File

@ -168,10 +168,13 @@ void playTone(int frequency, int ms) {
*/
//% help=music/stop-sound
//% blockId=music_stop_sounds block="stop all sounds"
//% parts="headphone" async
//% parts="headphone"
//% blockNamespace=music
//% weight=76 blockGap=8
void stopSounds() {
if (currentSample) {
samplePtr = currentSample->length;
}
_stopSound();
}

View File

@ -30,7 +30,7 @@ declare namespace music {
*/
//% help=music/stop-sound
//% blockId=music_stop_sounds block="stop all sounds"
//% parts="headphone" async
//% parts="headphone"
//% blockNamespace=music
//% weight=76 blockGap=8 shim=music::stopSounds
function stopSounds(): void;

View File

@ -43,8 +43,10 @@ namespace pxsim.SoundMethods {
}
export function stop() {
if (audio) {
audio.pause();
}
}
}