Add sounds (only simulator for now)

This commit is contained in:
Michal Moskal
2017-10-30 17:25:58 +00:00
parent a8a7267851
commit ebbbe6e86c
10 changed files with 541 additions and 39 deletions

17
libs/music/shims.d.ts vendored
View File

@ -24,6 +24,23 @@ declare namespace music {
//% blockNamespace=music
//% weight=76 blockGap=8 shim=music::playTone
function playTone(frequency: int32, ms: int32): void;
/** Makes a sound bound to a buffer in WAV format. */
//% shim=music::fromWAV
function fromWAV(buf: Buffer): Sound;
}
//% fixedInstances
declare interface Sound {
/** Returns the underlaying Buffer object. */
//% property shim=SoundMethods::buffer
buffer: Buffer;
/** Play sound with given volume. */
//% promise shim=SoundMethods::play
play(volume: int32): void;
}
// Auto-generated. Do not edit. Really.