As explained before in the forum these are two additions to the audio layer of the player:
The AudioResampler is meant to wrap any AudioDecoder and intersects if SetFormat or SetPitch are called.
I haven't changed anything in the sdl audio files so these changes only affect background music as sound effects don't use the AudioDecoder class.
(audio) added decoder for libsndfile
(audio) added libsndfile as optional library
(audio) Added libsndfile decoder to the autoselection feature of Audi…
(audio) added a wrapper around audio decoder to resample arbitrary sa…
…mplerate changes (powered by libspeexdsp or libsamplerate)
(audio) added libspeexdsp as optional library to autotools
(audio) Added AudioResampler to the autoselection feature of AudioDec…
Jenkins: Test this please
For Sound effects it's fine. SDL is able to play most of them. We only get resampler issues when streaming data because sounds are played in one go but no music.
Thanks, looks really great. Much better than the code I have to review at my company 👍 Going to test it :)
This will need adjustments for Windows (Visual Studio) but I will do this with another pull request after merging this one because it's ugly ;)
Works perfect in SDL, even with nonsense rates like 10000 or 23456
Only one thing: In AudioResampler.cpp you have
blocks. This doesn't match the coding style (and you only use it in one of your files)
(audio) coding style: added license header to decoder_libsndfile
(audio) coding style: added license header to audio_resampler and rem…
…oved block separating comments
Thanks for the kind reply!
The block seperating comments are removed.
btw. is there a reason you guarded only the internal stuff from the libraries in audio_resampler.h and decoder_libsndfile.h? It will not link without the libs (if using the functions) anyway, so it would make sense to empty the files when the preprocessor macros are not defined imo.
No there is no "real" reason - I just tried to follow the style of the two existing decoders (fmmidi and mpg123).
In fact the header files aren't used anyway if the macros aren't defined. The inclusion in audio_decoder.cpp is macro dependent as well.
Should i change it?
(audio) coding style: Empty decoder_libsndfile.h if HAVE_LIBSNDFILE i…
…s not defined
(audio) coding style: Empty audio_resampler.h if HAVE_LIBSPEEXDSP or …
…HAVE_LIBSAMPLERATE is not defined
Finnally found time to test the tempo. Works great 👍