Skip to main content
Version: 0.2.3

Interface: Audio

audio/AudioModule.Audio

Hierarchy

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

NativeJSRef.ID

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.

caution

While this is an async function, it does not need to be awaited. 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