[Speex-dev] Speex Resampler
René Schümann
white06tiger at gmx.de
Thu Jul 15 04:15:32 PDT 2010
Hello,
my problem is a bit identical to Devi's except that i try to use Speex's
Resampler from SpeexDSP and not "Echo Cancellation" but it won't work too :P
I was happy as i heard that Speex includes one, because my Programm or
better dll i want to build needs to be closed source and so other SRC's
like the one from Secret Rabbit isn't a choice. It must be LGPL or else.
But i can't get Speex resampler to work, it just don't gives any error
and does like it finished as I've expected but the converted Samples are
only in the middle part of the buffer changed. all other one is the same...
This is my code i tried:
SpeexResamplerState *mspeex_src_state;
float buf[3528]; //gets my float samples from bass
float bufout[640]; //speex resample out buffer
spx_uint32_t buf_len = 0; //set later by bass
spx_uint32_t bufout_len = 320; //when i use 640 which is correct, the program crashes.
int speex_err = 0;
mspeex_src_state = speex_resampler_init(2,44100,8000,4,&speex_err);
// other code eg. using bass to feed "buf" and set buf_len etc. but this part is correct.
speex_err = speex_resampler_process_interleaved_float(mspeex_src_state,buf,&buf_len,bufout,&bufout_len);
// speex_err: 0, buf_len: 1764, bufout_len: 320, so resampler does like it worked but it doesn't
can someone give me an example code or say what's wrong with mine?
Kind Regards
White-Tiger (René Schümann)
PS: i know my English isn't the best, but you can help me by saying
what's wrong and i try to fix that ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20100715/b92c0908/attachment.htm
More information about the Speex-dev
mailing list