[Interest] Qt6 porting guidance: QSound? QAudioFormat: endian, codec?

Doris Verria doris.verria at qt.io
Mon Aug 9 19:50:30 CEST 2021


Hi,

Sorry if I was unclear.
I mean that the decoded audio will have the same sample rate, sample format, and channel count as that of the original media. Not codec. QAudioDecoder will always output uncompressed PCM data.

If you have an mp3 file of format 32k, 16bit signed int, stereo, QAudioDecoder will output PCM data of 32k, 16bit signed int, stereo from it.
If the sample size (bit depth) is not known, often the case for some compressed formats like mp3 and aac, the sample format of the decoded audio will default to 16bit signed int.

As mentioned, in Qt6 Beta2 there's no way to set a specific format to decode in (other than that of the encoded file).

Best,
Doris

On 9.8.21, 4:58 PM, "David M. Cotter" <dave at kjams.com> wrote:

    > QAudioDecoder now decodes to the native format used in the encoded file
    do you mean if the native format is mp3, that i'm going to get mp3 data? if so, how is that considered "decoding" ?

    > That is, it will output in the same channel count, sample rate, sample format (the bits per sample information is sometimes irrelevant for compressed formats and therefore will be 0 or not known.
    i don't get it. i thought the point was to get PCM / raw uncompressed data?

    does Qt6 Beta2 have some facility for "conforming" the output of QAudioDecoder to, say, 44.1k, 16bit signed int, Stereo?

    -dave



More information about the Interest mailing list