Re: grabing audio samples from output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bill Unruh escreveu:
> On Wed, 7 Jan 2009, danflu@xxxxxxxxxxxxx wrote:
>
>> Hello,
>>
>> I'm writing a streamming audio application that criticaly
>> depends on a "echo cancellation" mechanism in order to work
>> well.
>>
>> The "echo canceler" algorithm receive as input both the
>> samples from microphone and the "echo samples" that come
>> from speaker (idealy both at the same timestamp) and make
>> all the calculations needed to cancel the echo at the mic
>> input.
>
> I have no idea what you mean by "echo samples" from the speaker. You 
> have the
> output to the speaker, but that is not necessarily what the speaker 
> actually
> produces ( there are phase shifts due to the mass of the cone, the 
> support of
> the cone, the cross over networks, the impedance of the cone, etc. ) 
> If you
> really want the "output" of the speaker, you need to put a pressure 
> mic right at the
> speaker and even then you have problems at higher frequencies.

Yes you're rigth. I got your point. What I really meant to say as "echo 
samples" is the signal that is going to be processed by the speakers at 
the processing time, not the actual sound that it produces...

Look at the function doc bellow (from libspeex)

speex_echo_cancellation(echo_state, input_frame, echo_frame, output_frame);
where input_frame is the audio as captured by the microphone, echo_frame 
is the signal that was played in the speaker (and needs to be removed) 
and output_frame is the signal with echo removed.

I've heard somewhere that there were a way to get the sound output 
("output here considering what I said on the first line.") from speaker 
at the OS kernel level, but I'm not sure if this is really possible...

Thank you for your reply
Daniel

>
>>
>> The thing I really need to figure out is how to can get the
>> audio from the output using alsa(speaker) since the API I've
>> been using so far (openal) aparently doesn't have this
>> funcionality.
>
> About all you can do is to get the input to the speaker, but that is 
> buffered
> by varying amounts of time, and thus the output from the speaker is 
> shifted
> from any input you can sample.
>
> You could feed the output to a line-in input on a sound card. 
> Unfortunately
> most cards have only one input stream.
>
>


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux