libsndfile / libsamplerate

An audio Sample Rate Conversion library
http://libsndfile.github.io/libsamplerate/
BSD 2-Clause "Simplified" License
600 stars 167 forks source link

Int16 support? #215

Closed alexey-v-paramonov closed 3 months ago

alexey-v-paramonov commented 4 months ago

I do all my audio processing as int16, is it possible to make libsamplerate work without the need to multiply/divide by 32768 for float conversion? If there is a fork or an alternative library for int processing - let me know.

Functions src_int_to_float_array src_float_to_int_array really help, but maybe there is a way not to use that extra step to save some CPU?

erikd commented 3 months ago

Doing your processing on int16 sounds so 1990s to me.

Slowest grade machines less than 10 years old have more than enough memory and CPU power to process floats.

alexey-v-paramonov commented 3 months ago

Well, I get my int16s from another program as source audio so I can not do much about it.

erikd commented 3 months ago

Well, I get my int16s from another program as source audio so I can not do much about it.

So convert them once on the way into your app and (if needed) once on the way out. Dealing with floats in audio processing is orders of magnitude easier than dealing with int16. All of the big name audio processing programs have operated exclusively on floats or doubles for well over a decade.

alexey-v-paramonov commented 3 months ago

Thanks, will do.

erikd commented 3 months ago

Please close this if you are happy with the outcome.

midn1 commented 2 months ago

Doing your processing on int16 sounds so 1990s to me.

IOW, int16 isn't supported because the authors would rather chase trends than write quality software.

erikd commented 2 months ago

@midn1 Dude this is Open Source software written by volunteers. You are free to fork the code and do with it whatever is allowed by the license. Please have at it.