Thread overview
Announcing audio-formats v1.0.0
Mar 18
ketmar
Mar 18
ketmar
Mar 18
ketmar
March 18
Hi,


audio-formats is a new pure D #DUB package that allows to decode and encode audio files.



# Features

- decode #WAV / #FLAC / #MP3 (LGPL in that case)
- encode #WAV
- support for chunked load and writes (32-bit float as interchange)
- support for nothrow @nogc
- support for FILE* or memory buffers
- single-threaded
- designed to deprecate the `wave-d` package
- interleaved input and output


# Limitations

Note that this cannot _play_ sound, or resample sound, and that you would need a lockfree queue to exchange with an audio-thread. So for now it is merely for offline processes. SDL_mixer is recommended if you want a complete solution.


# To go further

* DUB: https://code.dlang.org/packages/audio-formats
* GitHub: https://github.com/AuburnSounds/audio-formats
* Public API: https://audio-formats.dpldocs.info/
* Example code: https://github.com/AuburnSounds/audio-formats/blob/master/examples/transcode/source/main.d


Stay @safe!
March 18
On Wednesday, 18 March 2020 at 18:41:11 UTC, Guillaume Piolat wrote:
>
> audio-formats is a new pure D #DUB package that allows to decode and encode audio files.

Also: it's just a custom repackaging of the huge work of Ketmar.
https://repo.or.cz/iv.d.git


March 18
Guillaume Piolat wrote:

> On Wednesday, 18 March 2020 at 18:41:11 UTC, Guillaume Piolat wrote:
>>
>> audio-formats is a new pure D #DUB package that allows to decode and encode audio files.
>
> Also: it's just a custom repackaging of the huge work of Ketmar.
> https://repo.or.cz/iv.d.git

glad you found it useful! but why only that? there is GPL Opus decoder too, and two decoders for Ogg/Vorbis: stb and complete port of the official Xyph tremor library. also, you can find a resampler there, taken from Speex. are you planning to use those too in the future?
March 18
On Wednesday, 18 March 2020 at 18:49:23 UTC, ketmar wrote:
>
> glad you found it useful! but why only that? there is GPL Opus decoder too, and two decoders for Ogg/Vorbis: stb and complete port of the official Xyph tremor library. also, you can find a resampler there, taken from Speex. are you planning to use those too in the future?

It's a triple "yes". I haven't yet found the time to do it but figured it could be useful already :) Hope you are well ketmar.
March 18
Guillaume Piolat wrote:

> On Wednesday, 18 March 2020 at 18:49:23 UTC, ketmar wrote:
>>
>> glad you found it useful! but why only that? there is GPL Opus decoder too, and two decoders for Ogg/Vorbis: stb and complete port of the official Xyph tremor library. also, you can find a resampler there, taken from Speex. are you planning to use those too in the future?
>
> It's a triple "yes". I haven't yet found the time to do it but figured it could be useful already :) Hope you are well ketmar.

yeah. and thank you for your work! that code was simply rotting there, but now people may find some use for it. i am very bad at making my code useful for others, so i really appreciate your efforts! thanks again!
March 18
On Wednesday, 18 March 2020 at 20:25:45 UTC, ketmar wrote:
> Guillaume Piolat wrote:
>
>> On Wednesday, 18 March 2020 at 18:49:23 UTC, ketmar wrote:
>>>
>>> glad you found it useful! but why only that? there is GPL Opus decoder too, and two decoders for Ogg/Vorbis: stb and complete port of the official Xyph tremor library. also, you can find a resampler there, taken from Speex. are you planning to use those too in the future?
>>
>> It's a triple "yes". I haven't yet found the time to do it but figured it could be useful already :) Hope you are well ketmar.
>
> yeah. and thank you for your work! that code was simply rotting there, but now people may find some use for it. i am very bad at making my code useful for others, so i really appreciate your efforts! thanks again!

My pleasure!

Any input concerning stb_vorbis vs Tremor? Tremor is twice the code size and I'm not sure the one to be favoured.
March 18
Guillaume Piolat wrote:

> Any input concerning stb_vorbis vs Tremor? Tremor is twice the code size and I'm not sure the one to be favoured.

tbh, i didn't really tested stb much (if at all). it *should* work, but... my audio player was based on tremor, so it is better tested. maybe just make `version`, and let the user decide? ;-)
March 18
On Wednesday, 18 March 2020 at 21:24:55 UTC, ketmar wrote:
> tbh, i didn't really tested stb much (if at all).

I stole your code in my repo and use it with simpleaudio... i haven't used it super extensively (nor is it in my dub file btw) but what I have done with it works beautifully fine.