-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[AUDIO_WORKET] Add support for setting the render quantum size #25747
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
Changes from 6 commits
c2952bb
c013e88
1af27ca
d7e40b7
e455f22
50e4a04
d7136ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -1269,7 +1269,8 @@ | |||
| "structs": { | ||||
| "EmscriptenWebAudioCreateAttributes": [ | ||||
| "latencyHint", | ||||
| "sampleRate" | ||||
| "sampleRate", | ||||
| "renderSizeHint" | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I copied what the JS API now calls it: emscripten/src/lib/libwebaudio.js Line 106 in e455f22
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if there are any users of this API yet, could we rename
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The spec mixes the two, even for the Currently there's no reason to use this call, since it's always been 128. It's handy before the callback for calculating the stack size, and I should write an example of this. |
||||
| ], | ||||
| "WebAudioParamDescriptor": [ | ||||
| "defaultValue", | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,16 @@ extern "C" { | |
|
|
||
| typedef int EMSCRIPTEN_WEBAUDIO_T; | ||
|
|
||
| // Default render size of 128 frames | ||
| #define AUDIO_CONTEXT_RENDER_SIZE_DEFAULT 0 | ||
| // Let the hardware determine the best render size | ||
| #define AUDIO_CONTEXT_RENDER_SIZE_HARDWARE -1 | ||
|
|
||
| typedef struct EmscriptenWebAudioCreateAttributes | ||
| { | ||
| const char *latencyHint; // Specify one of "balanced", "interactive" or "playback" | ||
| uint32_t sampleRate; // E.g. 44100 or 48000 | ||
| int32_t renderSizeHint; // AUDIO_CONTEXT_RENDER_SIZE_* or number of samples | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I presume since this is a hint, the context creation is allowed to not honor it?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
From the spec: https://webaudio.github.io/web-audio-api/#dom-audiocontextoptions-rendersizehint "It is a hint that might not be honored." |
||
| } EmscriptenWebAudioCreateAttributes; | ||
|
|
||
| // Creates a new Web Audio AudioContext, and returns a handle to it. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| { | ||
| "a.html": 519, | ||
| "a.html.gz": 357, | ||
| "a.js": 4235, | ||
| "a.js.gz": 2170, | ||
| "a.js": 4309, | ||
| "a.js.gz": 2219, | ||
| "a.wasm": 1329, | ||
| "a.wasm.gz": 895, | ||
| "total": 6083, | ||
| "total_gz": 3422 | ||
| "total": 6157, | ||
| "total_gz": 3471 | ||
| } |
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.
Wonder if a verb got cut off from this comment, or maybe this was intentionally brief?
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 made sense when I typed it... I'll clarify it.