Interface: Audio
audio/AudioModule.Audio
Hierarchy
↳ Audio
Properties
ID
• ID: string
The internal ID for the object instance in native. Instead of serializing the object in native and sending it via the React Native Bridge, each native object will be assigned an ID which is sent to JavaScript instead. The ID will be used to reference the native object instance when calling functions on the JavaScript object.
Inherited from
Methods
getDuration
▸ getDuration(): number
Get the duration of an audio in ms.
Returns
number
pause
▸ pause(): void
Pause an audio.
Returns
void
play
▸ play(): void
Play an audio.
Returns
void
release
▸ release(): Promise
<void>
Until explicitly released, an Audio will have a reference in memory.
Not calling Audio.release can eventually result in an
OutOfMemoryException
.
While this is an async
function, it does not need to be await
ed. For
example, the GC
on Android will eventually free the allocated memory.
Returns
Promise
<void>
stop
▸ stop(): void
Stop the current playing audio.
Returns
void