Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/audiodocs/docs/analysis/analyser-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ It inherits all methods from [`AudioNode`](/docs/core/audio-node#methods).
Copies current frequency data into given array.
Each value in the array represents the decibel value for a specific frequency.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `array` | `Float32Array` | The array to which frequency data will be copied. |

Expand All @@ -64,7 +64,7 @@ Each value in the array represents the decibel value for a specific frequency.
Copies current frequency data into given array.
Each value in the array is within the range 0 to 255.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `array` | `Uint8Array` | The array to which frequency data will be copied. |

Expand All @@ -75,7 +75,7 @@ Each value in the array is within the range 0 to 255.
Copies current time-domain data into given array.
Each value in the array is the magnitude of the signal at a particular time.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `array` | `Float32Array` | The array to which time-domain data will be copied. |

Expand All @@ -86,7 +86,7 @@ Each value in the array is the magnitude of the signal at a particular time.
Copies current time-domain data into given array.
Each value in the array is within the range 0 to 255, where value of 127 indicates silence.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `array` | `Uint8Array` | The array to which time-domain data will be copied. |

Expand Down
4 changes: 2 additions & 2 deletions packages/audiodocs/docs/core/audio-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function App() {

Connects one of the node's outputs to a destination.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `destination` | [`AudioNode`](/docs/core/audio-node) or [`AudioParam`](/docs/core/audio-param) | `AudioNode` or `AudioParam` to which to connect. |

Expand All @@ -103,7 +103,7 @@ Connects one of the node's outputs to a destination.

Disconnects one or more nodes from the node.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `destination` <Optional /> | [`AudioNode`](/docs/core/audio-node) or [`AudioParam`](/docs/core/audio-param) | `AudioNode` or `AudioParam` from which to disconnect. |

Expand Down
14 changes: 7 additions & 7 deletions packages/audiodocs/docs/core/audio-param.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ as they are more efficient for continuous changes. For more specific use cases,

![](/img/setValueAtTime.png)

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `value` | `number` | A float representing the value the `AudioParam` will be set at given time |
| `startTime` | `number` | The time, in seconds, at which the change in value is going to happen. |
Expand All @@ -58,7 +58,7 @@ The change begins at the time designated for the previous event. It follows a li

![](/img/linearRampToValueAtTime.png)

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `value` | `number` | A float representing the value, the `AudioParam` will ramp to by given time. |
| `endTime` | `number` | The time, in seconds, at which the value ramp will end. |
Expand All @@ -78,7 +78,7 @@ The change begins at the time designated for the previous event. It follows an e

![](/img/exponentialRampToValueAtTime.png)

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `value` | `number` | A float representing the value the `AudioParam` will ramp to by given time. |
| `endTime` | `number` | The time, in seconds, at which the value ramp will end. |
Expand All @@ -98,7 +98,7 @@ This method is useful for decay or release portions of [ADSR envelopes](/docs/ef

![](/img/setTargetAtTime.png)

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `target` | `number` | A float representing the value to which the `AudioParam` will start transitioning. |
| `startTime` | `number` | The time, in seconds, at which exponential transition will begin. |
Expand All @@ -119,7 +119,7 @@ Schedules the parameters's value change following a curve defined by given array

![](/img/setValueCurveAtTime.png)

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `values` | `Float32Array` | The array of values defining a curve, which change will follow. |
| `startTime` | `number` | The time, in seconds, at which change will begin. |
Expand All @@ -137,7 +137,7 @@ Schedules the parameters's value change following a curve defined by given array

Cancels all scheduled changes after given cancel time.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `cancelTime` | `number` | The time, in seconds, after which all scheduled changes will be cancelled. |

Expand All @@ -153,7 +153,7 @@ Cancels all scheduled changes after given cancel time.

Cancels all scheduled changes after given cancel time, but holds its value at given cancel time until further changes appear.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `cancelTime` | `number` | The time, in seconds, after which all scheduled changes will be cancelled. |

Expand Down
16 changes: 7 additions & 9 deletions packages/audiodocs/docs/core/base-audio-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Creates [`RecorderAdapterNode`](/docs/sources/recorder-adapter-node).

Creates [`WorkletNode`](/docs/worklets/worklet-node).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `worklet` | `(Array<Float32Array>, number) => void` | The worklet to be executed. |
| `bufferLength` | `number` | The size of the buffer that will be passed to the worklet on each call. |
Expand All @@ -83,7 +83,7 @@ Creates [`WorkletNode`](/docs/worklets/worklet-node).

Creates [`WorkletSourceNode`](/docs/worklets/worklet-source-node).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `worklet` | `(Array<Float32Array>, number, number, number) => void` | The worklet to be executed. |
| `workletRuntime` | `AudioWorkletRuntime` | The kind of runtime to use for the worklet. See [worklet runtimes](/docs/worklets/worklets-introduction#what-kind-of-worklets-are-used-in-react-native-audio-api) for details. |
Expand All @@ -100,7 +100,7 @@ Creates [`WorkletSourceNode`](/docs/worklets/worklet-source-node).

Creates [`WorkletProcessingNode`](/docs/worklets/worklet-processing-node).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `worklet` | `(Array<Float32Array>, Array<Float32Array>, number, number) => void` | The worklet to be executed. |
| `workletRuntime` | `AudioWorkletRuntime` | The kind of runtime to use for the worklet. See [worklet runtimes](/docs/worklets/worklets-introduction#what-kind-of-worklets-are-used-in-react-native-audio-api) for details. |
Expand All @@ -117,7 +117,7 @@ Creates [`WorkletProcessingNode`](/docs/worklets/worklet-processing-node).

Creates [`AudioBuffer`](/docs/sources/audio-buffer).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `numOfChannels` | `number` | An integer representing the number of channels of the buffer. |
| `length` | `number` | An integer representing the length of the buffer in sampleFrames. Two seconds buffer has length equals to `2 * sampleRate`. |
Expand All @@ -137,7 +137,7 @@ Creates [`AudioBuffer`](/docs/sources/audio-buffer).

Creates [`AudioBufferSourceNode`](/docs/sources/audio-buffer-source-node).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `pitchCorrection` <Optional /> | [`AudioBufferBaseSourceNodeOptions`](/docs/sources/audio-buffer-source-node#constructor) | Dictionary object that specifies if pitch correction has to be available. |

Expand All @@ -147,7 +147,7 @@ Creates [`AudioBufferSourceNode`](/docs/sources/audio-buffer-source-node).

Creates [`AudioBufferQueueSourceNode`](/docs/sources/audio-buffer-queue-source-node).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `pitchCorrection` <Optional /> | [`AudioBufferBaseSourceNodeOptions`](/docs/sources/audio-buffer-queue-source-node#constructor) | Dictionary object that specifies if pitch correction has to be available. |

Expand Down Expand Up @@ -181,7 +181,7 @@ Creates [`ConstantSourceNode`](/docs/sources/constant-source-node).

Creates [`PeriodicWave`](/docs/effects/periodic-wave). This waveform specifies a repeating pattern that an OscillatorNode can use to generate its output sound.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `real` | `Float32Array` | An array of cosine terms. |
| `imag` | `Float32Array` | An array of sine terms. |
Expand Down Expand Up @@ -287,8 +287,6 @@ const buffer = await Asset.fromModule(require('@/assets/music/example.mp3'))

Decodes base64-encoded PCM audio data.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `base64String` | `string` | Base64-encoded PCM audio data. |
Expand Down
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/core/offline-audio-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It inherits all methods from [`BaseAudioContext`](/docs/core/base-audio-context#

Schedules a suspension of the time progression in audio context at the specified time.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `suspendTime` | `number` | A floating-point number specifying the suspend time, in seconds. |

Expand Down
4 changes: 2 additions & 2 deletions packages/audiodocs/docs/effects/biquad-filter-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ It inherits all methods from [`AudioNode`](/docs/core/audio-node#methods).

### `getFrequencyResponse`

| Parameters | Type | Description |
| Parameter | Type | Description |
| :--------: | :--: | :---------- |
| `frequencyArray` | `Float32Array` | Array of frequencies (in Hz), which you want to filter. |
| `magResponseOutput` | `Float32Array` | Output array to store the computed linear magnitude values for each frequency. For frequencies outside the range [0, $\frac{sampleRate}{2}$], the corresponding results are NaN. |
Expand Down Expand Up @@ -93,4 +93,4 @@ Numerically: Q ≈ 770.63678.
- Positive values correspond to amplification; negative to attenuation.

#### `type`
- [`BiquadFilterType`](#biquadfiltertype-enumeration-description). Default: `"lowpass"`.
- [`BiquadFilterType`](#biquadfiltertype-enumeration-description). Default: `"lowpass"`.
4 changes: 2 additions & 2 deletions packages/audiodocs/docs/inputs/audio-recorder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Stops recording.
Connects recorder to the adapter. If the recorder is already connected, it will switch to the new adapter (it is equivalent to calling disconnect() previously).
Be careful `RecorderAdapterNode` can be connected only once. You can't connect same adapter twice (even to different recorders).

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `node` | [`RecorderAdapterNode`](/docs/sources/recorder-adapter-node) | Adapter that we want to connect to. |

Expand All @@ -85,7 +85,7 @@ Disconnects recorder from the currently connected adapter. It does not need to b

Sets a callback after every portion of data deliverance.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `callback` | [`(OnAudioReadyEventType => void)`](/docs/inputs/audio-recorder#onaudioreadyeventtype) | The callback function to handle audio data. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ It inherits all methods from [`AudioBufferBaseSourceNode`](/docs/sources/audio-b

Adds another buffer to queue. Returns `bufferId` that can be used to identify the buffer in `onEnded` event.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `buffer` | [`AudioBuffer`](/docs/sources/audio-buffer) | Buffer with next data. |

Expand All @@ -69,7 +69,7 @@ Adds another buffer to queue. Returns `bufferId` that can be used to identify th

Removes a buffer from the queue. Note that `onEnded` event will not be fired for buffers that were removed.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `bufferId` | `string` | ID of the buffer to remove from the queue. It should be valid id provided by `enqueueBuffer` method. |

Expand All @@ -81,6 +81,13 @@ Removes all buffers from the queue. Note that `onEnded` event will not be fired

#### Returns `undefined`.

### `pause`

Stops audio immediately. Unlike [`stop()`](/docs/sources/audio-scheduled-source-node#stop), which fully stops playback and clears the queued buffers,
pause() halts the audio while keeping the current playback position, allowing you to resume from the same point later.

#### Returns `undefined`.

## Events

### `onEnded` <Overridden />
Expand Down
11 changes: 6 additions & 5 deletions packages/audiodocs/docs/sources/audio-buffer-source-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ It inherits all methods from [`AudioBufferBaseSourceNode`](/docs/sources/audio-b

### `start` <Overridden /> {#start}

Schedules `AudioBufferSourceNode` to start playback of audio data contained in the associated [`AudioBuffer`](/docs/sources/audio-buffer), or starts to play immediately.
Schedules the `AudioBufferSourceNode` to start playback of audio data contained in the associated [`AudioBuffer`](/docs/sources/audio-buffer), or starts to play immediately.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `when` | `number` | The time, in seconds, at which the node will start to play. |
| `offset` <Optional /> | `number` | An offset, in seconds, determines the starting point for audio playback. |
| `duration` <Optional /> | `number` | The duration, in seconds, of audio playback. |
| `when` <Optional /> | `number` | The time, in seconds, at which playback is scheduled to start. If `when` is less than [`AudioContext.currentTime`](/docs/core/base-audio-context#properties) or set to 0, the node starts playing immediately. <br /> Default: `0`. |
| `offset` <Optional /> | `number` | The position, in seconds, within the audio buffer where playback begins. <br /> The default value is `0`, which starts playback from the beginning of the buffer. If the offset exceeds the buffer’s [`duration`](/docs/sources/audio-buffer#properties) (or the defined [`loopEnd`](/docs/sources/audio-buffer-source-node#properties) value), it’s automatically clamped to the valid range. <br /> Offsets are calculated using the buffer’s natural sample rate rather than the current playback rate — so even if the sound is played at double speed, halfway through a 10-second buffer is still 5 seconds. |
| `duration` <Optional /> | `number` | The playback duration, in seconds. If not provided, playback continues until the sound ends naturally or is manually stopped with [`stop() method`](/docs/sources/audio-scheduled-source-node#stop). <br /> Equivalent to calling `start(when, offset)` followed by `stop(when + duration)`. |


#### Errors:

Expand Down
8 changes: 4 additions & 4 deletions packages/audiodocs/docs/sources/audio-buffer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See example implementations in [`BaseAudioContext`](/docs/core/base-audio-contex
| Name | Type | Description | |
| :----: | :----: | :-------- | :-: |
| `sampleRate` | `number` | Float value representing sample rate of the PCM data stored in the buffer. | <ReadOnly /> |
| `length` | `length` | Integer value representing length of the PCM data stored in the buffer. | <ReadOnly /> |
| `length` | `number` | Integer value representing length of the PCM data stored in the buffer. | <ReadOnly /> |
| `duration` | `number` | Double value representing duration, in seconds, of the PCM data stored in the buffer. | <ReadOnly /> |
| `numberOfChannels` | `number` | Integer value representing the number of audio channels of the PCM data stored in the buffer. | <ReadOnly /> |

Expand All @@ -38,7 +38,7 @@ See example implementations in [`BaseAudioContext`](/docs/core/base-audio-contex

Gets modifiable array with PCM data from given channel.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `channel` | `number` | Index of the `AudioBuffer's` channel, from which data will be returned. |

Expand All @@ -54,7 +54,7 @@ Gets modifiable array with PCM data from given channel.

Copies data from given channel of the `AudioBuffer` to an array.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `destination` | `Float32Array` | The array to which data will be copied. |
| `channelNumber` | `number` | Index of the `AudioBuffer's` channel, from which data will be copied. |
Expand All @@ -73,7 +73,7 @@ Copies data from given channel of the `AudioBuffer` to an array.

Copies data from given array to specified channel of the `AudioBuffer`.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `source` | `Float32Array` | The array from which data will be copied. |
| `channelNumber` | `number` | Index of the `AudioBuffer's` channel to which data will be copied. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ It inherits all methods from [`AudioNode`](/docs/core/audio-node#methods).
Schedules the node to start audio playback at specified time. If no time is given, it starts immediately.
You can invoke this method only once in node's life.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `when` | `number` | The time, in seconds, at which the node will start to play. |

Expand All @@ -45,7 +45,7 @@ You can invoke this method only once in node's life.
Schedules the node to stop audio playback at specified time. If no time is given, it stops immediately.
If you invoke this method multiple times on the same node before the designated stop time, the most recent call overwrites previous one.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `when` | `number` | The time, in seconds, at which the node will stop playing. |

Expand Down
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/sources/oscillator-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ It inherits all methods from [`AudioScheduledSourceNode`](/docs/sources/audio-sc

Sets any periodic wave.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `wave` | [`PeriodicWave`](/docs/effects/periodic-wave) | Data representing custom wave. [`See for reference`](/docs/core/base-audio-context#createperiodicwave) |

Expand Down
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/sources/streamer-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ It inherits all methods from [`AudioScheduledSourceNode`](/docs/sources/audio-sc

Initializes the streamer with a link to an external HLS source.

| Parameters | Type | Description |
| Parameter | Type | Description |
| :---: | :---: | :---- |
| `streamPath` | `string` | Link pointing to an external HLS source |

Expand Down
Loading