This plugin provides the ability to record and play back audio files on a device. NOTE: The current implementation does not adhere to a W3C specification for media capture, and is provided for convenience only. A future implementation will adhere to the latest W3C specification and may deprecate the current APIs.
Media
The duration of the media, in seconds.
The position within the audio playback, in seconds. Not automatically updated during play; call getCurrentPosition to update.
Returns the current position within an audio file. Also updates the Media object's position parameter.
The callback that is passed the current position in seconds.
The callback to execute if an error occurs.
Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
number
Pauses playing an audio file.
Starts or resumes playing an audio file.
Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed.
Sets the current position within an audio file.
Position in milliseconds.
Set the volume for an audio file.
The volume to set for playback. The value must be within the range of 0.0 to 1.0.
Starts recording an audio file.
Stops playing an audio file.
Stops recording an audio file.