Skip to content

Commit 12d2d89

Browse files
chmjkbNorbertKlockiewicz
authored andcommitted
fix: make react-native-audio-api a peer dependency (#126)
## Description <!-- Provide a concise and descriptive summary of the changes implemented in this PR. --> ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update (improves or adds clarity to existing documentation) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> --------- Co-authored-by: Norbert Klockiewicz <[email protected]>
1 parent 14ec028 commit 12d2d89

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ https://docs.swmansion.com/react-native-executorch
3030
```bash
3131
# Install the package
3232
yarn add react-native-executorch
33+
# Install necessary peer dependency
34+
yarn add react-native-audio-api
3335
cd ios && pod install && cd ..
3436
```
3537

docs/docs/fundamentals/getting-started.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,30 @@ If your app still runs on the old architecture, please consider upgrading to the
2222

2323
## Installation
2424

25-
Installation is pretty straightforward, just use your favorite package manager.
25+
Installation is pretty straightforward, just use your favorite package manager. We use React Native Audio API as a peer dependency to make it possible to load audio for Speech To Text.
2626

2727
<Tabs>
2828
<TabItem value="npm" label="NPM">
2929

3030
npm install react-native-executorch
31+
npm install react-native-audio-api
3132

3233
</TabItem>
3334
<TabItem value="pnpm" label="PNPM">
3435

3536
pnpm install react-native-executorch
37+
pnpm install react-native-audio-api
3638

3739
</TabItem>
3840
<TabItem value="yarn" label="YARN">
3941

4042
yarn add react-native-executorch
43+
yarn add react-native-audio-api
4144

4245
</TabItem>
4346
</Tabs>
4447

45-
If you plan on adding your models to the assets instead of fetching them from a url, you also need to add following lines to your `metro.config.js`:
48+
If you plan on using your models via require() instead of fetching them from a url, you also need to add following lines to your `metro.config.js`:
4649

4750
```json
4851
// metro.config.js
@@ -58,6 +61,10 @@ This allows us to use binaries, such as exported models or tokenizers for LLMs.
5861
When using Expo, please note that you need to use a custom development build of your app, not the standard Expo Go app. This is because we rely on native modules, which Expo Go doesn’t support.
5962
:::
6063

64+
:::caution
65+
If you encountered an error that native modules for React Native Audio API were not installed, please make sure to install react-native-audio-api.
66+
:::
67+
6168
:::info
6269
Because we are using ExecuTorch under the hood, you won't be able to build iOS app for release with simulator selected as the target device. Make sure to test release builds on real devices.
6370
:::

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"prettier": "^3.0.3",
7777
"react": "18.3.1",
7878
"react-native": "^0.76.1",
79+
"react-native-audio-api": "0.4.13",
7980
"react-native-builder-bob": "^0.30.2",
8081
"turbo": "^1.10.7",
8182
"typescript": "^5.2.2"
@@ -85,7 +86,8 @@
8586
},
8687
"peerDependencies": {
8788
"react": "*",
88-
"react-native": "*"
89+
"react-native": "*",
90+
"react-native-audio-api": "*"
8991
},
9092
"workspaces": [
9193
"example"
@@ -198,7 +200,6 @@
198200
"expo-file-system": "^18.0.10",
199201
"react": "18.3.1",
200202
"react-native": "0.76.7",
201-
"react-native-audio-api": "0.4.11",
202203
"react-native-live-audio-stream": "^1.1.1"
203204
}
204205
}

yarn.lock

+8-5
Original file line numberDiff line numberDiff line change
@@ -11596,13 +11596,15 @@ __metadata:
1159611596
languageName: node
1159711597
linkType: hard
1159811598

11599-
"react-native-audio-api@npm:0.4.11":
11600-
version: 0.4.11
11601-
resolution: "react-native-audio-api@npm:0.4.11"
11599+
"react-native-audio-api@npm:0.4.13":
11600+
version: 0.4.13
11601+
resolution: "react-native-audio-api@npm:0.4.13"
1160211602
peerDependencies:
1160311603
react: "*"
1160411604
react-native: "*"
11605-
checksum: 7e80da3fc61881f61dcb676da6dcf0255ee2ea2d35ee39b40d8a329efdc0e5dd483cd2f820cba0b014042f9118d4c1a3d12456d3cab8de6cceda751df3b5e885
11605+
bin:
11606+
setup-rn-audio-api-web: scripts/setup-rn-audio-api-web.js
11607+
checksum: 9a5db4626a0663224cdcdc957ed5176df9ed65df9f58bf06c5eae2a91895b7ee0f0a632ecaa79b23ef7536983485cea2720ca46201e2e690548f400b66970ff6
1160611608
languageName: node
1160711609
linkType: hard
1160811610

@@ -11662,14 +11664,15 @@ __metadata:
1166211664
prettier: ^3.0.3
1166311665
react: 18.3.1
1166411666
react-native: ^0.76.1
11665-
react-native-audio-api: 0.4.11
11667+
react-native-audio-api: 0.4.13
1166611668
react-native-builder-bob: ^0.30.2
1166711669
react-native-live-audio-stream: ^1.1.1
1166811670
turbo: ^1.10.7
1166911671
typescript: ^5.2.2
1167011672
peerDependencies:
1167111673
react: "*"
1167211674
react-native: "*"
11675+
react-native-audio-api: "*"
1167311676
languageName: unknown
1167411677
linkType: soft
1167511678

0 commit comments

Comments
 (0)