Records a sound of a given duration. Returns a Sound promise.
How the function behaves in detail:
record_for is called.
The function waits for the given buffer duration.
The recording signal is played.
Recording begins when the recording signal finishes.
The recording signal plays to signal the end after the given duration.
Parameters
duration: number
duration in seconds
buffer: number
pause before recording, in seconds
Returns SoundPromise
Example
init_record(); constpromise = record_for(2, 0.5); // begin recording after 0.5s for 2s constsound = promise(); // retrieve the recorded sound play(sound); // and do whatever with it
Records a sound of a given duration. Returns a Sound promise.
How the function behaves in detail:
record_foris called.