pxt-calliope/libs/core/soundexpressions.cpp

28 lines
571 B
C++
Raw Normal View History

2021-11-25 17:27:39 +01:00
#include "pxt.h"
namespace music {
/**
* Internal use only
**/
//% async
void __playSoundExpression(String nodes, bool waitTillDone) {
#if MICROBIT_CODAL
if (waitTillDone)
uBit.audio.soundExpressions.play(MSTR(nodes));
else
uBit.audio.soundExpressions.playAsync(MSTR(nodes));
#else
target_panic(PANIC_VARIANT_NOT_SUPPORTED);
#endif
}
/**
* Internal use only
*/
//%
void __stopSoundExpressions() {
#if MICROBIT_CODAL
uBit.audio.soundExpressions.stop();
#endif
}
}