-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: main
Are you sure you want to change the base?
Conversation
|
||
# AudioBufferBaseSourceNode | ||
|
||
The `AudioBufferBaseSourceNode` interface is an [`AudioScheduledSourceNode`](/sources/audio-scheduled-source-node) which aggregates behavior of nodes that requires [`AudioBuffer`](/sources/audio-buffer). |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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` | |
There was a problem hiding this comment.
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. | |
There was a problem hiding this comment.
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 /> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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
Closes RNAA-147
Introduced changes
Checklist