I wonder how reliable it would be to do this since it can change, for 
example you could ask for a sampleRate and get less. What happens if it 
changes during playback?

As I see it it should be read from the callback

On Friday, November 22, 2024 at 5:24:42 PM UTC+1 [email protected] wrote:

> But how do I figure out what the audio sample rate is?
>
>
> It's a property of the audio worklet global scope, but you can also query 
> it from the returned context, something like:
>
> emscriptenGetAudioObject(context).sampleRate
>
> I'm going to be proposing API changes so that it's passed to the callback 
> (in a struct with other data).
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/emscripten-discuss/418ef67a-9223-4399-9e23-d0fdf4ce8078n%40googlegroups.com.

Reply via email to