Getting started
The goal of Fundamentals is to guide you through the setup process of the Audio API, as well as to show the basic concepts behind audio programming using a web audio framework, giving you the confidence to explore more advanced use cases on your own. This section is packed with interactive examples, code snippets, and explanations. Are you ready? Let's make some noise!
Installation
It takes only a few steps to add Audio API to your project:
Install the package
Install the react-native-audio-api
package from npm:
- EXPO
- NPM
- YARN
npx expo install react-native-audio-api
npm install react-native-audio-api
yarn add react-native-audio-api
Usage with expo
react-native-audio-api
contains native custom code and isn't part of the Expo Go application. In order to be available in expo managed builds, you have to use Expo development build. Simplest way on starting local expo dev builds, is to use:
- iOS
- Android
npx expo run:ios
npx expo run:android
To learn more about expo development builds, please check out Development Builds Documentation.
Android
No further steps are necessary.
iOS
While developing for iOS, make sure to install pods first before running the app:
cd ios && pod install && cd ..
Web
No further steps are necessary.
react-native-audio-api
on the web exposes the browser's built-in Web Audio API, but for compatibility between platforms, it limits the available interfaces to APIs that are implemented on iOS and Android.
Clear Metro bundler cache (recommended)
- EXPO
- NPM
- YARN
npx expo start -c
npm start -- --reset-cache
yarn start --reset-cache
What's next?
In the next section, we will learn how to prepare Audio API and to play some sound!.