How to add audio to your Expo app, in short
You add audio to an Expo app with the expo-audio library. Install it with npx expo install expo-audio. In a component, create a player with the useAudioPlayer hook, passing a local file (require('./assets/tap.mp3')) or a URL. Then call player.play() when you want the sound. To pause, call player.pause(). To show progress, read the player's state with useAudioPlayerStatus. That is enough for sound effects, a meditation track, a voice note or a podcast-style player.
The play button is the easy part. What causes problems is the audio session: sound that plays while the phone is on silent (or does not), your app stopping the user's Spotify, audio that cuts out when the screen locks, and a background audio permission you did not mean to ship. This guide covers each of those.
Step 1: Install expo-audio
- Run: npx expo install expo-audio. Using expo install instead of npm install picks a version that matches your SDK.
- Put your sound files in your project, for example assets/sounds. Short MP3 or M4A files are a safe choice for both platforms. Expo's reference links to Apple's and Android's own lists of supported formats if you need something unusual.
- Start testing in Expo Go if you like. expo-audio is included in Expo Go, so playing a sound works there. Config plugin options, like background playback and the microphone permission text, only take effect in a development build or a store build.
If you are not sure whether you are on Expo Go or a development build, read [Expo Go vs a development build](/blog/expo-go-vs-development-build) first. You will need a development build anyway before you ship.
Step 2: Play a sound with useAudioPlayer
The minimal version, straight from the pattern in Expo's docs:
- Import the hook: import { useAudioPlayer } from 'expo-audio'.
- Inside your component: const player = useAudioPlayer(require('../assets/sounds/success.mp3')).
- Play it from a button: onPress={() => player.play()}.
- To replay a sound that already finished, rewind first: player.seekTo(0) then player.play(). Expo's own replay example does exactly this. Calling play() alone on a finished sound is a common reason a second tap does nothing.
The player has the controls you would expect: pause(), seekTo(seconds), a volume property from 0.0 to 1.0, loop for background music, and replace(source) to swap in a different file without creating a new player. Note that seekTo takes seconds, not milliseconds. expo-av used milliseconds in many places, which is an easy bug to carry over.
For a progress bar or a play/pause button that shows the right icon, use useAudioPlayerStatus(player). It returns live values including playing, currentTime and duration (both in seconds), isLoaded and didJustFinish. Use didJustFinish to move to the next track or reset your UI when a sound ends.
Step 3: Set the audio mode so sound behaves on iOS
Every app that plays sound has an audio session, and it decides three things users notice right away. You set it once with setAudioModeAsync, usually in your root layout:
The setAudioModeAsync options that matter most
| Option | What it controls | Typical choice |
|---|---|---|
| playsInSilentMode | Whether sound plays when the phone is on silent | true for music, meditation, video or voice apps |
| interruptionMode | What happens to other apps' audio: mixWithOthers, duckOthers or doNotMix | mixWithOthers for sound effects, doNotMix for a music or podcast player |
| shouldPlayInBackground | Whether audio keeps playing when the app goes to the background | true only if your app is actually an audio player |
My recommendation: set all three explicitly, even if a default already matches what you want. Defaults have changed between SDK versions, and a one-line setAudioModeAsync call in your root layout documents your intent for anyone (or any AI) reading the code later. For an app whose sounds are UI feedback, use mixWithOthers so a tap sound never pauses the user's music. Expo's reference describes mixWithOthers as best suited for sound effects and short clips. For an app where audio is the product, use doNotMix.
Step 4: Background playback and lock screen controls
If your app plays long audio (music, sleep sounds, lessons, audiobooks), users expect it to keep going when they lock the phone. That takes two pieces:
- The config plugin in app.json: plugins: [["expo-audio", { "enableBackgroundPlayback": true }]]. On iOS this adds the audio UIBackgroundModes entry. On Android it adds the foreground service permissions and a media playback service. Rebuild your development build after changing it.
- The runtime audio mode: setAudioModeAsync({ playsInSilentMode: true, shouldPlayInBackground: true, interruptionMode: 'doNotMix' }).
- Lock screen controls: call player.setActiveForLockScreen(true, { title, artist, albumTitle, artworkUrl }) when playback starts. Expo's docs note interruptionMode must be doNotMix for the OS to attach the controls to your player.
On iOS, Expo's docs say playback continues in the background once the session is set up with shouldPlayInBackground, and lock screen controls are optional. On Android they are not optional: without setActiveForLockScreen, the docs say background audio stops after roughly 3 minutes because of an OS limit.
Recording audio from the microphone
expo-audio also records. The short version of Expo's example:
- Set a real microphone permission message in the config plugin: "microphonePermission": "Allow $(PRODUCT_NAME) to record voice notes you choose to save." This becomes NSMicrophoneUsageDescription on iOS. Write it to say what the recording is for, since App Review reads it.
- Ask for permission with AudioModule.requestRecordingPermissionsAsync() and handle a denial gracefully. The general patterns are in [how to request permissions in your Expo app](/blog/how-to-request-permissions-in-your-expo-app).
- Set the mode for recording: setAudioModeAsync({ playsInSilentMode: true, allowsRecording: true }).
- Create a recorder with useAudioRecorder(RecordingPresets.HIGH_QUALITY), then call prepareToRecordAsync() and record(). Use useAudioRecorderState to show a recording indicator.
- Call stop(). The file is at audioRecorder.uri.
One detail that bites later: Expo's docs say recordings are saved in the app's cache directory by default, and the system may delete cache files when storage runs low. If users expect to keep their recordings, pass directory: 'document' in the recording options (spread over the preset) so the files go to the document directory instead.
Mistakes that make audio fail in Expo
- Following an expo-av tutorial. Audio.Sound.createAsync, unloadAsync and positionMillis are the old API. Use expo-audio.
- Calling play() on a sound that already finished and expecting it to restart. Seek to 0 first.
- Passing milliseconds to seekTo. It takes seconds.
- Creating players with createAudioPlayer inside a component and never calling release().
- Changing the expo-audio config plugin and only reloading. Plugin changes need a new build.
- Shipping the default background mode in an app that does not play audio in the background.
- Testing only in the simulator with the volume up. Test on a real iPhone with the silent switch on, with music playing in another app, and with the screen locked.
- Shipping large uncompressed WAV files. Every bundled sound adds to the download. See [how to reduce your Expo app size](/blog/how-to-reduce-your-expo-app-size).
Have Claude Code set it up for you
Open your project in the Claude Code desktop app and describe the behavior, not just "add sound". Most of the decisions in this post are about how audio should behave, and the AI cannot guess those. A prompt that works:
Swap the audio mode lines if your app is a player rather than an app with sound effects. Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) like "audio uses expo-audio, never expo-av; all sounds go through useSound" so a later session does not pull in the old library from a stale example. Rebuild, and test the silent switch and the lock screen on a real device.
The short version
To add audio to your Expo app: install expo-audio, create a player with useAudioPlayer, and call play(). Rewind with seekTo(0) to replay. Set the audio mode once with setAudioModeAsync so silent mode, other apps' music and backgrounding behave the way you intend. Only keep background playback enabled in the config plugin if your app really plays audio in the background, and on Android turn on lock screen controls so it does not stop after a few minutes. For recording, set a clear microphone permission message and save to the document directory if the files matter.
If you are building your first iOS app with Claude Code and Expo and want a second pair of eyes on it before App Review, bring it to App Store Launch Club. Members share their builds for feedback, and the [curriculum](/curriculum) covers the full path from first build to first users. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
Should I use expo-audio or expo-av?
Use expo-audio. expo-av is deprecated and is no longer in Expo's latest SDK reference. expo-audio covers playback and recording with a hooks-based API (useAudioPlayer, useAudioRecorder).
Does expo-audio work in Expo Go?
Yes, expo-audio is included in Expo Go, so basic playback works there. Config plugin settings such as background playback and a custom microphone permission message need a development build.
Why does my Expo sound only play once?
After a sound finishes, its position stays at the end. Call player.seekTo(0) before player.play() to replay it, which is the pattern Expo's own example uses.
How do I play audio when the iPhone is on silent?
Call setAudioModeAsync({ playsInSilentMode: true }). Set it explicitly rather than relying on the default, and set it to false if your sounds are only UI feedback that should respect the silent switch.
How do I keep audio playing in the background in Expo?
Enable background playback in the expo-audio config plugin, call setAudioModeAsync with shouldPlayInBackground: true, and on Android turn on lock screen controls with player.setActiveForLockScreen, or playback stops after about 3 minutes.
How do I stop my app's sounds from pausing the user's music?
Set interruptionMode to 'mixWithOthers' in setAudioModeAsync. Your sounds then play alongside other apps' audio instead of taking over.
Will background audio get my app rejected?
It can if your app does not need it. Apple's guideline 2.5.4 limits background services to their intended purposes, such as audio playback. The expo-audio plugin enables background playback by default, so set enableBackgroundPlayback to false if your app does not play audio in the background.
Last reviewed by David on October 15, 2026

