Constructor
new Microphone(options)
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Extends
- PsychObject
Methods
(protected) _onChange()
- Source:
Callback for changes to the recording settings.
Changes to the settings require the recording to stop and be re-started.
(async, protected) _prepareRecording()
- Source:
Prepare the recording.
download(filename)
- Source:
Offer the audio recording to the participant as a sound file to download.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
filename |
string |
audio.webm
|
the filename |
flush() → {Promise}
- Source:
Submit a request to flush the recording.
Returns:
promise fulfilled when the data has actually been made available
- Type
- Promise
(async) getRecording(tag, flushopt)
- Source:
Get the current audio recording as an AudioClip in the given format.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tag |
string | an optional tag for the audio clip |
||
flush |
boolean |
<optional> |
false
|
whether or not to first flush the recording |
pause() → {Promise}
- Source:
Submit a request to pause the recording.
Returns:
promise fulfilled when the recording actually paused
- Type
- Promise
resume(options) → {Promise}
- Source:
Submit a request to resume the recording.
resume has no effect if the recording was not previously paused.
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
promise fulfilled when the recording actually resumed
- Type
- Promise
start() → {Promise}
- Source:
Submit a request to start the recording.
Note that it typically takes 50ms-200ms for the recording to actually starts once a request to start has been submitted.
Returns:
promise fulfilled when the recording actually started
- Type
- Promise
stop(options) → {Promise}
- Source:
Submit a request to stop the recording.
Parameters:
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
promise fulfilled when the recording actually stopped, and the recorded data was made available
- Type
- Promise
(async) upload(tag)
- Source:
Upload the audio recording to the pavlovia server.
Parameters:
Name | Type | Description |
---|---|---|
tag |
string | an optional tag for the audio file |