www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Announcing audio-formats v1.0.0

reply Guillaume Piolat <firstname.lastname gmail.com> writes:
Hi,


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





- 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




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.




* 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!
Mar 18
next sibling parent reply Guillaume Piolat <firstname.lastname gmail.com> writes:
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
Mar 18
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
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?
Mar 18
parent reply Guillaume Piolat <firstname.lastname gmail.com> writes:
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.
Mar 18
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
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!
Mar 18
parent reply Guillaume Piolat <firstname.lastname gmail.com> writes:
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.
Mar 18
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
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? ;-)
Mar 18
parent Adam D. Ruppe <destructionator gmail.com> writes:
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.
Mar 18
prev sibling parent Guillaume Piolat <firstname.lastname gmail.com> writes:
On Wednesday, 18 March 2020 at 18:41:11 UTC, Guillaume Piolat 
wrote:


 - decode #WAV / #FLAC / #MP3 (LGPL in that case)
Update in v1.1.0: - MP3 decoding is now Boost-compatible (with a new minimp3 translation) - OPUS decoding added (LGPL in that case) - OGG not working yet but will probably happen
Apr 07