mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
11 lines
286 B
JavaScript
11 lines
286 B
JavaScript
(function(pitch, callback, length) {
|
|
if (!isFinite(length)) length=6000;
|
|
var w = new Waveform(length);
|
|
w.on("finish", function(buf) {
|
|
Microbit.MIC_ENABLE.reset();
|
|
if (callback) callback(w.buffer);
|
|
});
|
|
Microbit.MIC_ENABLE.set();
|
|
w.startInput(Microbit.MIC, pitch);
|
|
})
|