Picks audio data from the library or the recorder.
This method is supported on Android devices only.
Name | Description | Type | Use |
---|---|---|---|
output |
Passed to set the output configuration. It can be structured as follows:
{ saveToFile, saveToData }
Please see the table below for details. |
object |
required |
options |
Passed to set the configuration for the audio file. Default values will be used if the object is empty. It can be structured as follows:
{ sourceType, url }
Please see the table below for details. |
object |
required |
callbacks | Passed to verify whether the devce was able to capture any audio. It can be structured as follows:
{ onSuccess: function(success) {...}, onCancel: function() {...}, onFailure: function(error) {...} }
|
object |
required |
The table below lists parameters passed via the output
object.
Parameter | Description | Type |
---|---|---|
saveToFile |
Saves to FileEntry URL or a temporary File API URL if the "url" setting is not
specified in the |
Boolean |
saveToData | Indicates whether to return a Data URL or not. By default it is set to "false". | Boolean |
The table below lists parameters passed via the options
object.
Parameter | Description | Type |
---|---|---|
sourceType | Source of audio data. Possible source types are listed in the Constants table of the Media article. The default setting is USER_CHOICE. It displays a native picker that allows to select either a built-in voice recorder application or the audio roll. | String |
url | A URL address obtained from the FileEntry object by calling the toURL method. If not provided, a URL address of the temporary storage is generated. | String |
The table below lists all callbacks supported by the method.
Name | Description | Return type |
---|---|---|
onSuccess |
Called when the function finishes without an error. The method's object consists of the following fields:
|
undefined |
onCancel | Called when the user cancels picking or recording an audio. | undefined |
onFailure |
Called when an error occurs. The |
undefined |