Skip to content

docs: rest of sources #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

docs: rest of sources #525

wants to merge 2 commits into from

Conversation

mdydek
Copy link
Contributor

@mdydek mdydek commented Jun 25, 2025

Closes RNAA-147

⚠️ Breaking changes ⚠️

Introduced changes

  • added docs for audio buffer base source node
  • added docs for audio buffer queue source node

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web

@mdydek mdydek added the documentation Improvements or additions to documentation label Jun 25, 2025

# AudioBufferBaseSourceNode

The `AudioBufferBaseSourceNode` interface is an [`AudioScheduledSourceNode`](/sources/audio-scheduled-source-node) which aggregates behavior of nodes that requires [`AudioBuffer`](/sources/audio-buffer).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dont we move playbackRate and detune properties to AudioBufferBaseSourceNode section? There are common for all nodes using AudioBuffers


audioBufferSourceNode.onPositionChangedInterval = 100; //setting frequency to ~10Hz

audioBufferSourceNode.onPositionChanged = null; //removing callback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is a great place to show how to remove callback, If I were you, I will add it to the description of callbacks


function App() {
const ctx = new AudioContext();
const audioBufferBaseSourceNode = ctx.createBufferSource();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we cannot create AudioBufferBaseSourceNode, so lets change the naming to source / sourceNode

```

:::caution
Tested only on Android and iOS.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Android and iOS only, we do not have stubs for web -> we have to add them, hence I will change it to mobile only feature or Android and iOS only

| Parameters | Type | Description |
| :---: | :---: | :---- |
| `buffer` | [`AudioBuffer`](/sources/audio-buffer) | Buffer with next data. |
| `isLastBuffer` | `boolean` | Boolean indicating if it is a last buffer. Default value is `false` |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is my responsibility, but it could be great to describe what it gives -> queue will stop if buffer with isLastBuffer = true will end.

## Properties

| Name | Type | Description |
| :----: | :----: | :-------- |
| `buffer` | [`AudioBuffer`](/sources/audio-buffer) | Associated `AudioBuffer`. |
| `detune` | [`AudioParam`](/core/audio-param) | [`k-rate`](/core/audio-param#a-rate-vs-k-rate) `AudioParam` representing detuning of oscillation in cents. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AudioBufferBaseSourceNode does not have these props

@@ -51,19 +55,14 @@ If you invoke this method multiple times on the same node before the designated

### `onended` <Experimental />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not experimental any more

};

source.start(context.currentTime, offset)
audioBufferSourceNode.onended = null; //removing callback
```

:::caution
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have the same impl on web

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean :::caution part


### `createBufferQueueSource`

The above method lets you create [`AudioBufferQueueSourceNode`](/sources/audio-buffer-queue-source-node).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some note about "mobile only" could be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants