@capgo/native-audio
A native plugin for native audio engine.
Overview
Section titled “Overview”A native plugin for native audio engine.
Core Capabilities
Section titled “Core Capabilities”configure- Configure the audio player.preload- Load an audio file.playOnce- Play an audio file once with automatic cleanup.isPreloaded- Check if an audio file is preloaded.
Public API
Section titled “Public API”| Method | Description |
|---|---|
configure | Configure the audio player. |
preload | Load an audio file. |
playOnce | Play an audio file once with automatic cleanup. |
isPreloaded | Check if an audio file is preloaded. |
play | Play an audio file. |
pause | Pause an audio file. |
resume | Resume an audio file. |
loop | Stop an audio file. |
stop | Stop an audio file. |
unload | Unload an audio file. |
setVolume | Set the volume of an audio file. |
setRate | Set the rate of an audio file. |
setCurrentTime | Set the current time of an audio file. |
getCurrentTime | Get the current time of an audio file. |
getDuration | Get the duration of an audio file in seconds. |
isPlaying | Check if an audio file is playing. |
addListener | Listen for complete event. |
addListener | Listen for current time updates Emits every 100ms while audio is playing. |
addListener | Listen for playback state changes, including notification and lock-screen transport controls. Emitted by Android and iOS. The current Web implementation does not emit this event. |
clearCache | Clear the audio cache for remote audio files. |
setDebugMode | Set debug mode logging. |
getPluginVersion | Get the native Capacitor plugin version. |
deinitPlugin | Deinitialize the plugin and restore original audio session settings This method stops all playing audio and reverts any audio session changes made by the plugin Use this when you need to ensure compatibility with other audio plugins. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-native-audio.