Records a sound until the returned stop function is called.
Takes a buffer duration (in seconds) as argument, and
returns a nullary stop. A call to the stop function returns a Sound promise.
How the function behaves in detail:
record is called.
The function waits for the given buffer duration.
The recording signal is played.
Recording begins when the recording signal finishes.
Recording stops when the returned stop function is called.
Parameters
buffer: number
pause before recording, in seconds
Returns ()=>SoundPromise
Example
init_record(); conststop = record(0.5); // record after 0.5 seconds. constpromise = stop(); // stop recording and get sound promoie constsound = promise(); // retrieve the recorded sound play(sound); // and do whatever with it
Records a sound until the returned stop function is called. Takes a buffer duration (in seconds) as argument, and returns a nullary stop. A call to the stop function returns a Sound promise.
How the function behaves in detail:
recordis called.