xiph / speexdsp

Speex audio processing library - THIS IS A MIRROR, DEVELOPMENT HAPPENS AT https://gitlab.xiph.org/xiph/speexdsp
https://speex.org
Other
469 stars 190 forks source link

How do I "guess" the output length of resampled data? #20

Closed VictorQueiroz closed 4 years ago

VictorQueiroz commented 5 years ago

I've been reading some examples of how to work with this library and for what it seems to be, it looks like we know the input length but we have to guess the output length. Am I correct? Or is it just a "read until there's no more" where I should process the input until there is no more samples to be read? https://github.com/xiph/speexdsp/blob/master/libspeexdsp/testresample2.c#L71

Thank you in advance!

romanbsd commented 5 years ago

You can "guess" the output length of the resampled data by desired/original ratio. And the last parameter of speex_resampler_process_float is updated to the actual number of samples.

tmatth commented 4 years ago

Sounds like @romanbsd answered your question, this kind of thing is best discussed on the speex-dev mailing list http://lists.xiph.org/pipermail/speex-dev/ or on #speex on freenode.