jetpack.notifications.show("Recording...");
jetpack.audio.recordToFile();
}
});
}
});
</pre>
=== Streaming ===
The ability to manipulate the incoming audio stream would be useful. The Jetpack audio module allows access to the raw audio stream. Here's an example:
<pre>
jetpack.future.import("audio");
var start = 0;
var samples = 0;
function myCallback(data, num) {
samples += num;
}
jetpack.statusBar.append({
html: 'Stream<i>!</i>',
width: 45,
onReady: function(doc) {
$(doc).click(function() {
if (jetpack.audio.isRecording) {
jetpack.audio.stopRecording();
jetpack.notifications.show("Received " + samples +
" in " + (Date.now() - start) + " seconds.");
} else {
start = Date.now();
jetpack.audio.recordToPipe(myCallback);
jetpack.notifications.show("Started recording to pipe");
}
});