Skip to content

Conversation

@cwoffenden
Copy link
Collaborator

Minor clarification of the docs and example.

@cwoffenden cwoffenden requested a review from juj November 10, 2025 15:49
``AudioSampleFrame``'s ``samplesPerChannel`` to get the value.
``AudioSampleFrame``'s ``samplesPerChannel`` to get the value (and request the
preferred number of samples with ``EmscriptenWebAudioCreateAttributes``'s
``renderSizeHint`` option).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just remove the hardcoded 128 value here and say "callback will be invoked for each N
samples of the processed (where N is is the number of samples per channel)".

The naming here also seems strange. Why is to called samplesPerChannel when its read but renderSizeHint when its hinted. Why not samplesPerChannelHint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

samplesPerChannel has been in the Emscripten API for about a year in prep for the web audio API changes. renderSizeHint is what the spec calls it and is now available in Chrome Canary.

I chose samplesPerChannel last year when extending the API, simply because it speaks the most to what it does and where it's accessed in the API (and having been doing this sort of thing since forever, I've never once heard anyone call it a render quantum).

I think it does make sense to change the 128, but I think it'll stay 128 for most people for a long time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Clarified the 128.

@sbc100 sbc100 merged commit 6f87785 into emscripten-core:main Nov 11, 2025
33 of 34 checks passed
@cwoffenden cwoffenden deleted the cw-aw-tweaks-1 branch November 11, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants