rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Support the QOA format

Open rdrpenguin04 opened this issue 5 months ago • 5 comments

The QOA file format is a simple lossy format that balances speed, size, and quality remarkably well. As an example, I took an audio file of a song I wrote that happens to have bad high-end artifacts with both MP3 and AAC. With QOA, the file was only twice as large as the MP3 render, and it sounded nearly equivalent to the uncompressed file.

There is a pure Rust implementation of the format as well, with no required dependencies. The one possible hitch with using it is that it has an optional dependency on rodio itself. If you believe it would be better for crates that want QOA support to just use qoaudio, that's fine too, though an implementation provided by rodio would give dependents (thinking of Bevy in particular) near-automatic support.

rdrpenguin04 avatar Jul 08 '25 22:07 rdrpenguin04

First of all I love the name. I'm not against adding more audio formats as they are all behind feature gates so no one needs to compile support they do not need.

Really nice that there is a pure rust implementation 🥳. Do note it is missing seek support, which means rodio will have to return SeekError::SeekNotSupported when anyone attempts seeking.

The one possible hitch with using it is that it has an optional dependency on rodio itself

Its only used for the examples and disabled by default, should not be a problem (for us).

though an implementation provided by rodio would give dependents (thinking of Bevy in particular) near-automatic support.

Agreed, would you like to give this a try? I does not seem very difficult to me. The other decoders (except symphonia do not look at symphonia its a bit too complex) should be perfect examples.

yara-blue avatar Jul 09 '25 08:07 yara-blue

Sounds good!

I've seen versions of QOA that support seeking, and that would be very important to support looping. I'll see what I can do to get seeking to work as well.

rdrpenguin04 avatar Jul 09 '25 14:07 rdrpenguin04

Format-native seeking would be great, but without it, you can still build a looped decoder with Rodio.

roderickvd avatar Jul 09 '25 15:07 roderickvd

I've seen versions of QOA that support seeking, and that would be very important to support looping. I'll see what I can do to get seeking to work as well.

I don't know how much time you have on your hands 😅 but maybe a PR at qoaudio adding seeking would be welcomed.

yara-blue avatar Jul 09 '25 15:07 yara-blue

I'll make an attempt at doing that at some point :D

rdrpenguin04 avatar Jul 10 '25 02:07 rdrpenguin04