Skip to content

Commit ce24d2d

Browse files
committed
fix: comments
1 parent a4560da commit ce24d2d

File tree

4 files changed

+42
-20
lines changed

4 files changed

+42
-20
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ check out the [Getting Started](https://docs.swmansion.com/react-native-audio-ap
3939
- <sub>[![Released in 0.6.0](https://img.shields.io/badge/Released_in-0.6.0-green)](https://github.com/software-mansion/react-native-audio-api/releases/tag/0.6.0)</sub> **System configuration** 🛠️ <br />
4040
Full control of system audio settings, remote controls, lock screen integration and most importantly configurable background modes <br />
4141

42+
- <sub>[![Released in 0.6.0](https://img.shields.io/badge/Released_in-0.6.0-green)](https://github.com/software-mansion/react-native-audio-api/releases/tag/0.6.0)</sub> **Connect audio param** 🤞 <br />
43+
Ability to connect Audio nodes to audio params, which will allow for powerful and efficient modulation of audio parameters, creating effects like tremolo, vibrato or complex envelope followers. <br />
44+
4245
- **Microphone support** 🎙️ <br />
4346
Grab audio data from device microphone or connected device, connect it to the audio graph or stream through the internet <br />
4447

45-
- **Connect audio param** 🤞 <br />
46-
Ability to connect Audio nodes to audio params, which will allow for powerful and efficient modulation of audio parameters, creating effects like tremolo, vibrato or complex envelope followers. <br />
47-
4848
- **JS Audio Worklets** 🐎 <br />
4949
Ability to run JS functions connected to the audio graph running on audio thread allowing for full customization of what happens to the audio signal.
5050
<br />

packages/audiodocs/docs/guides/create-your-own-effect.mdx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ Only parts that will be needed by you, are:
1919
- writing native specific code to compile those files
2020

2121
```bash
22-
npx rn-audioapi-custom-node-generator create -o #path where you want files to be generated, usually same height as android/ and ios/
22+
npx rn-audioapi-custom-node-generator create -o # path where you want files to be generated, usually same level as android/ and ios/
2323
```
2424

2525
## Analyzing generated files
2626

2727
You should see two directories:
28-
- `shared/` - it contains c++ files (source code for custom effect and jsi layer - host objects, needed to communicate with JavaScript)
28+
- `shared/` - it contains c++ files (source code for custom effect and JSI layer - Host Objects, needed to communicate with JavaScript)
2929
- `specs/` - defines typescript interface that will invoke c++ code in JavaScript
3030

3131
:::caution
3232
Name of the file in `specs/` has to start with `Native` to be seen by codegen.
3333
:::
3434

35-
The most important file is `MyProcessorNode.cpp`, because it contains main processing part that directly manipulates raw data.
35+
The most important file is `MyProcessorNode.cpp`, it contains main processing part that directly manipulates raw data.
3636

3737
In this guide, we will edit files in order to achieve [`GainNode`](/effects/gain-node) functionality.
3838
For the sake of a simplicity, we will use value as a raw `double` type, not wrapped in [`AudioParam`](/core/audio-param).
@@ -219,28 +219,24 @@ declare global {
219219
## Example
220220
221221
```tsx
222-
import React, { useRef } from 'react';
223222
import {
224223
AudioContext,
225224
OscillatorNode,
226225
} from 'react-native-audio-api';
227226
import { MyProcessorNode } from './types';
228227

229228
function App() {
230-
const audioContextRef = useRef<AudioContext | null>(null);
231-
if (!audioContextRef.current) {
232-
audioContextRef.current = new AudioContext();
233-
}
234-
const oscillator = audioContextRef.current.createOscillator();
229+
const audioContext = new AudioContext();
230+
const oscillator = audioContext.createOscillator();
235231
// constructor is put in global scope
236-
const processor = new MyProcessorNode(audioContextRef.current, global.createCustomProcessorNode(audioContextRef.current.context));
232+
const processor = new MyProcessorNode(audioContext, global.createCustomProcessorNode(audioContext.context));
237233
oscillator.connect(processor);
238-
processor.connect(audioContextRef.current.destination);
239-
oscillator.start(audioContextRef.current.currentTime);
234+
processor.connect(audioContext.destination);
235+
oscillator.start(audioContext.currentTime);
240236
}
241237
```
242238
243-
**If that's not satisfactory for you, check out fully working [demo app](https://github.com/software-mansion-labs/custom-processor-node-example)**
239+
**Check out fully working [demo app](https://github.com/software-mansion-labs/custom-processor-node-example)**
244240
245241
## What's next?
246242
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Cli custom audio node generator
2+
3+
This library contains source code and templates needed to create a node for custom audio processing used by [react-native-audio-api](https://github.com/software-mansion/react-native-audio-api).
4+
5+
## Usage
6+
7+
```bash
8+
npx rn-audioapi-custom-node-generator create -o # path
9+
```
10+
11+
## Community Discord
12+
13+
[Join the Software Mansion Community Discord](https://discord.swmansion.com) to chat about React Native Audio Api or other Software Mansion libraries.
14+
15+
## Library created by Software Mansion
16+
17+
[![swm](https://logo.swmansion.com/logo?color=white&variant=desktop&width=150&tag=react-native-reanimated-github 'Software Mansion')](https://swmansion.com)
18+
19+
Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – [Hire us](https://swmansion.com/contact/projects?utm_source=reanimated&utm_medium=readme).

packages/custom-node-generator/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"name": "rn-audioapi-custom-node-generator",
3-
"version": "0.0.2",
3+
"version": "0.0.4",
44
"description": "A cli generator for custom node used by react-native-audio-api",
55
"main": "lib/generator.js",
6-
"bin": {
7-
"my-generator": "./bin/cli.js"
8-
},
96
"author": "michal.dydek@swmansion.com",
107
"license": "MIT",
118
"dependencies": {
@@ -18,6 +15,16 @@
1815
"lib",
1916
"templates"
2017
],
18+
"keywords": [
19+
"react-native",
20+
"audio",
21+
"audio api",
22+
"web audio api",
23+
"custom",
24+
"custom node",
25+
"generator",
26+
"react-native-audio-api"
27+
],
2128
"engines": {
2229
"node": ">=12.0.0"
2330
}

0 commit comments

Comments
 (0)