Description
react-native-sound-player is an open-source React Native library for playing audio files and streams on iOS and Android. You add a sound file to your iOS project in Xcode or to the Android res/raw folder, then call playSoundFile with its file name and type to play it. Files kept in the project's assets folder can be played with playAsset, and the library can also stream audio from a URL. The README explains that playback stops when the screen sleeps, and that on iOS you can keep audio going in the background by enabling the Audio, AirPlay and Picture in Picture background mode. It also says the package is no longer actively maintained and points developers to react-native-track-player for new projects, which offers more playback features and an active community. The library suits existing apps that only need simple sound playback. Install it with yarn or npm; from React Native 0.60 onward, no separate linking step is needed.…
Highlights
- Play bundled sound files on iOS and Android
- Stream audio from a URL
- Play files from the project's assets folder
- Simple playSoundFile(fileName, fileType) call
- Background audio on iOS with a Background Mode setting
Ratings & Reviews
No ratings yet
Be the first to rate React Native Sound Player.
People also visit
React Native Sound Player FAQ
Is react-native-sound-player still maintained?
No. The README says the package is no longer actively maintained and recommends react-native-track-player for new projects.
How do I play a sound file?
Add the file to your iOS project in Xcode or to the Android res/raw folder, then call playSoundFile with the file name and file type.
Can it play audio from the internet?
Yes. The library can stream audio from a URL as well as play files stored in the app.
Does audio stop when the screen locks?
It can. The README says the device may sleep and stop playback, and on iOS you can enable the Audio, AirPlay and Picture in Picture background mode so audio keeps playing.
Do I need to link the library?
Not for React Native 0.60 and newer. Older versions need the extra linking step described in the README.
What are the best React Native Sound Player alternatives?
Popular alternatives to React Native Sound Player include React Native Track Player, React Native VLC Media Player and React Modern Audio Player. See all React Native Sound Player alternatives

