[Speex-dev] frame_size parameter

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Tue Mar 10 16:00:29 PDT 2009


In stereo mode, you need to use the init_mc() call and consider the
number of samples *per channel*. Also, more than 20 ms frames are a bad
idea.

	Jean-Marc

danflu at uninet.com.br a écrit :
> Hi,
> 
> I'm using the echo cancellation api and I would like to
> clarify the 'frame_size' parameter used in
> speex_echo_state_init(frame_size,filter_length).
> 
> 
> In the 'docs' it says:
> 
> "...where frame_size is the amount of data (in samples)you
> want to process at once..."
> 
> So... here are my questions:
> 
> if I use stereo input/output do I have to put the samples
> doubled ?
> For example... if I'm using 100 ms on mono 8khz I just pass
> 800 as 'frame_size', but if I switch on using stereo will I
> have to put 1600 samples to represent the same 100 ms? I'm
> looking at the code of 'speex_echo_playback' and I see the
> following snippet:
> 
> ...
> for (i=0;i<st->frame_size;i++)
>     st->play_buf[st->play_buf_pos+i] = play[i];
> ...
> 
> So... if my buffer is stereo and I put 800 samples as
> 'frame_size' the previous loop will just copy half of the
> 'play' buffer data (50 ms) or am I missing something ?
> 
> Thanks in advance,
> Daniel
> 
> 
> 
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
> 
> 


More information about the Speex-dev mailing list