Records a sound until the returned stop function is called.
Takes a buffer duration (in seconds) as argument, and
returns a nullary stop function stop. A call
stop() returns a Sound promise: a nullary function
that returns a Sound. Example:
init_record();
const stop = record(0.5);
// record after 0.5 seconds. Then in next query:
const promise = stop();
// In next query, you can play the promised sound, by
// applying the promise:
play(promise());
Parameters
buffer: number
pause before recording, in seconds
Returns (() => (() => Sound))
nullary stop function;
stop() stops the recording and
returns a Sound promise: a nullary function that returns the recorded Sound
Records a sound until the returned stop function is called. Takes a
buffer
duration (in seconds) as argument, and returns a nullary stop functionstop
. A callstop()
returns a Sound promise: a nullary function that returns a Sound. Example: