All types are exported directly fromDocumentation 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.
react-native-audio-pro with full TypeScript support. Import only what you need — every interface and type alias is tree-shakeable and ships with inline JSDoc comments to power your IDE’s autocomplete.
Track
AudioProArtwork
AudioProTrack.artwork. Accepting string directly means any URL scheme (https://, file://) or local asset path is valid.
AudioProTrack
Represents a single audio track. Pass this to queue methods such as AudioPro.addMediaItems(), AudioPro.setMediaItems(), or AudioPro.addMediaItemsAt().
Unique identifier for the track. Used internally for queue management and deduplication.
Remote URL or local file path to the audio resource.
Display title shown in the notification and lock screen media controls.
URL or local file path for the track artwork. Displayed in the notification and lock screen.
Optional album name. Displayed in some media control surfaces.
Optional artist name. Displayed in the notification and lock screen media controls.
Any additional custom properties are allowed. Useful for passing metadata through event payloads without a separate lookup.
Configuration
AudioProConfigureOptions
Passed to AudioPro.configure() to set global player behaviour. All fields are optional — unset fields fall back to documented defaults.
Declares the kind of audio content. Affects platform-level audio routing and optimisations. Defaults to
AudioProContentType.MUSIC.Enables verbose native logging to aid development. Default:
false.When
debug is true, also logs every PROGRESS event. Can be noisy — disable in most debug sessions. Default: false.How often (in milliseconds) the player emits
PROGRESS events. Default: 1000 (1 second).Duration (in milliseconds) used by the rewind/forward skip buttons in the notification and lock screen. Default:
30000 (30 seconds).Sets the initial repeat mode for the queue. Can be changed at runtime via
AudioPro.setRepeatMode().Sets the initial shuffle state. Can be toggled at runtime via
AudioPro.setShuffleModeEnabled().Maximum on-disk cache size in bytes. This is a global setting and may only take effect on first initialisation. Default:
524288000 (500 MB).Enables or disables the audio cache. Changing this setting requires a session restart to take full effect. Default:
true.Automatically skips silent sections during playback. Android only. Default:
false.Playback Options
AudioProPlayOptions
Passed as the optional argument to AudioPro.play() to control how playback starts.
When
true, playback begins immediately after the track is loaded. When false, the player loads the track and enters STOPPED state.Custom HTTP headers for network requests. See
AudioProHeaders below.Position in milliseconds at which playback should begin. Useful for resuming a track.
When
true, the track is appended to the queue rather than replacing it.AudioProHeaders
Custom HTTP headers sent when fetching audio streams and artwork. Both fields are independent — you can send headers for audio only, artwork only, or both.
Headers attached to the audio stream request (e.g.
Authorization, X-Custom-Token).Headers attached to the artwork image request.
Notification Buttons
AudioProNotificationButton
A union type of string literals representing the buttons that can appear in the media notification and lock screen controls. Pass an array of these to AudioPro.setNotificationButtons().
| Value | Description |
|---|---|
PLAY | Play button |
PAUSE | Pause button |
PREV | Previous track |
NEXT | Next track |
LIKE | Like / thumbs-up action |
DISLIKE | Dislike / thumbs-down action |
SAVE | Save to library action |
BOOKMARK | Bookmark action |
REWIND_30 | Rewind 30 seconds |
FORWARD_30 | Fast-forward 30 seconds |
Custom action buttons (
LIKE, DISLIKE, SAVE, BOOKMARK, REWIND_30, FORWARD_30) fire an AudioProEventType.CUSTOM_ACTION event. Read the payload.action field to identify which button was pressed.Event Types
AudioProEvent
The single event shape emitted by the main audio player. Your AudioProEventCallback receives this object for every player event.
Identifies which event occurred. See
AudioProEventType.The track that was active when the event fired.
null for REMOTE_NEXT and REMOTE_PREV events when no track is loaded.Event-specific data. The fields present depend on the
type. See the payload interfaces below for the full shape of each event.Payload Interfaces
Each payload interface represents the strongly-typed shape ofAudioProEvent.payload for a specific event type. Use these when you need precise types inside a switch/case handler.
AudioProStateChangedPayload
Emitted with AudioProEventType.STATE_CHANGED.
The new player state.
Current playback position in milliseconds at the moment of the state change.
Total track duration in milliseconds.
AudioProTrackEndedPayload
Emitted with AudioProEventType.TRACK_ENDED.
Final playback position in milliseconds when the track ended.
Total track duration in milliseconds.
AudioProPlaybackErrorPayload
Emitted with AudioProEventType.PLAYBACK_ERROR.
Human-readable error message from the underlying player.
JS-friendly error code mapped from Media3 error codes. See
AudioProErrorCode.true means the player is still usable and may retry automatically. false means the session has failed.Optional cause string from the underlying native exception.
Queue index of the track where the error occurred.
AudioProProgressPayload
Emitted with AudioProEventType.PROGRESS on the interval set by progressIntervalMs.
Current playback position in milliseconds.
Total track duration in milliseconds.
How many milliseconds of audio have been buffered ahead of the current position.
AudioProSeekCompletePayload
Emitted with AudioProEventType.SEEK_COMPLETE after a seek operation finishes.
The position in milliseconds where playback resumed after the seek.
Total track duration in milliseconds.
Indicates whether the seek was initiated by your app/user code (
USER) or by the system/remote controls (SYSTEM).AudioProPlaybackSpeedChangedPayload
Emitted with AudioProEventType.PLAYBACK_SPEED_CHANGED.
The new playback speed as a multiplier (e.g.
1.0 = normal, 1.5 = 1.5×, 0.75 = 75%).AudioProQueueChangedPayload
Emitted with AudioProEventType.QUEUE_CHANGED whenever the queue is modified (add, remove, move, or clear).
Total number of tracks now in the queue.
Zero-based index of the currently active track in the updated queue.
Callback Types
AudioProEventCallback
AudioPro.addEventListener(). The callback is called on the JS thread for every player event.
AudioProAmbientEventCallback
AudioPro.addAmbientListener().
Ambient Audio Types
AmbientAudioPlayOptions
Passed to AudioPro.ambientPlay() to configure ambient (secondary) audio playback.
Remote URL or local file path for the ambient audio resource.
When
true, the ambient track loops indefinitely until AudioPro.ambientStop() is called. Defaults to true.AudioProAmbientEvent
The event shape emitted by the ambient player. Your AudioProAmbientEventCallback receives this object.
Identifies which ambient event occurred. See
AudioProAmbientEventType.Optional event-specific data.
AudioProAmbientErrorPayload
Strongly-typed shape of the payload for AudioProAmbientEventType.AMBIENT_ERROR events.
Human-readable description of the ambient playback error. The ambient player is automatically cleaned up after an error.
Equalizer Types
AudioProEqualizerBand
Describes a single frequency band in the 10-band equalizer.
Centre frequency of the band in Hz (e.g.
31, 1000, 16000).Human-readable label for the band (e.g.
'31Hz', '1kHz', '16kHz').AudioProEqualizerPreset
Describes a named equalizer preset with per-band gain values.
Display name for the preset (e.g.
'Rock', 'Vocal Clarity (Adv)').Stable identifier used to look up and apply the preset (e.g.
'rock', 'adv-vocal-clarity').Array of 10 gain values in dB, one per band ordered from 31 Hz to 16 kHz.
Optional prose description of the preset’s sonic character. All advanced presets include a description.