Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/afkcodes/react-native-audio-pro/llms.txt

Use this file to discover all available pages before exploring further.

AudioPro.configure() should be called once during app startup — typically in your root component or app entry file — before any playback begins. It accepts an AudioProConfigureOptions object that controls how the player behaves. Configuration is merged with built-in defaults, so you only need to specify the options you want to override.
Configuration changes are stored immediately but only take effect on the next play() call. Calling configure() while audio is already playing will not alter the current playback session.

Options

contentType
AudioProContentType
default:"MUSIC"
Controls the audio session category on both Android and iOS, which affects routing, ducking, and interruption behavior. Use AudioProContentType.MUSIC for music and long-form audio, or AudioProContentType.SPEECH for podcasts, audiobooks, and voice content.
import { AudioProContentType } from 'react-native-audio-pro';

// MUSIC (default) — optimized for music playback
AudioPro.configure({ contentType: AudioProContentType.MUSIC });

// SPEECH — optimized for voice/podcast content
AudioPro.configure({ contentType: AudioProContentType.SPEECH });
debug
boolean
default:"false"
Enables verbose logging from both the native layer and the TypeScript layer. Useful during development to trace playback events, state transitions, and method calls. Disable in production builds.
debugIncludesProgress
boolean
default:"false"
When debug is true, setting this to true will also include PROGRESS events in the debug logs. Progress events fire frequently (at the progressIntervalMs rate), so this option is disabled by default to avoid log flooding.
progressIntervalMs
number
default:"1000"
The frequency in milliseconds at which PROGRESS events are emitted during playback. Accepts values between 100 and 10000. Lower values give smoother scrubber UI updates at the cost of more frequent events.
// Emit progress every 500ms for a smoother seek bar
AudioPro.configure({ progressIntervalMs: 500 });
skipIntervalMs
number
default:"30000"
The number of milliseconds used for skip-forward and skip-back operations, as well as the REWIND_30 and FORWARD_30 notification buttons. Defaults to 30 seconds (30000 ms).
repeatMode
AudioProRepeatMode
default:"OFF"
Sets the default repeat mode for the queue. Accepts one of:
  • AudioProRepeatMode.OFF — no repeat (default)
  • AudioProRepeatMode.ONE — repeat the current track indefinitely
  • AudioProRepeatMode.ALL — repeat the entire queue after the last track ends
The repeat mode can also be changed at runtime with AudioPro.setRepeatMode().
shuffleMode
boolean
Sets the initial shuffle state. When true, the queue is played in a randomised order. Can be changed at runtime with AudioPro.setShuffleModeEnabled().
maxCacheSize
number
default:"524288000"
Maximum disk cache size in bytes. Defaults to 500 MB (524,288,000 bytes). This is a global setting that may only take full effect during the first initialization of the underlying cache store.
cacheEnabled
boolean
default:"true"
Enables or disables the on-device audio cache. When true, streamed audio is cached locally so subsequent plays of the same URL skip the network request.
Changing cacheEnabled requires a session restart to take full effect on the underlying data source. This means either force-quitting the app or calling AudioPro.stop() and then re-calling configure() before the next play().
skipSilence
boolean
default:"false"
When enabled, the player automatically skips silent segments during playback. Android only. Has no effect on iOS.

Complete Example

import {
  AudioPro,
  AudioProContentType,
  AudioProRepeatMode,
} from 'react-native-audio-pro';

// Call once at app startup, before any play() call
AudioPro.configure({
  contentType: AudioProContentType.MUSIC,
  progressIntervalMs: 500,
  skipIntervalMs: 15000,
  repeatMode: AudioProRepeatMode.OFF,
  shuffleMode: false,
  cacheEnabled: true,
  maxCacheSize: 524288000, // 500 MB
  skipSilence: false,
  debug: __DEV__,
  debugIncludesProgress: false,
});

Default Values

All fields are optional. The following defaults are applied when a field is omitted:
OptionDefault
contentTypeAudioProContentType.MUSIC
debugfalse
debugIncludesProgressfalse
progressIntervalMs1000
skipIntervalMs30000
repeatModeAudioProRepeatMode.OFF
shuffleModefalse
cacheEnabledtrue
maxCacheSize524288000 (500 MB)
skipSilencefalse

Build docs developers (and LLMs) love