Structure of OnAudioStreamPacket's raw PCM data

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Structure of OnAudioStreamPacket's raw PCM data

Postby cybersight » Sun Mar 24, 2024 11:45 am

I'm trying to understand why the `data` argument to OnAudioStreamPacket has type float**. Does this mean it is an array of array of floats, with the outer array length being the number of channels, and the inner arrays length being the number of frames? Or are the channels already interleaved into a single float array?

AFAIK most audio interfaces expect PCM data to be interleaved, but if it was already interleaved here I would expect `data` to have type float*.
cybersight
Techie
 
Posts: 38
Joined: Mon Dec 11, 2023 11:04 am

Re: Structure of OnAudioStreamPacket's raw PCM data

Postby cybersight » Sun Mar 24, 2024 4:07 pm

Okay, I think I've confirmed that float** is indeed an array of float arrays, and that they need to be interleaved by the handler.

I've managed to get OnAudioStreamPacket working with SDL3's new push-based audio API, and it's working really well so far. Highly recommend for anyone using a managed language and/or wants to ditch the standard audio callback interface.
cybersight
Techie
 
Posts: 38
Joined: Mon Dec 11, 2023 11:04 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 231 guests