<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hello All<br><br>I'm accessing speex via jni, I have successfully
decoded and encoded data and capture and play it back in java. Now my
challenge is speex's echo canceller.<br>My capture and playback are not synchronized, so i got to use the method from 1.2beta2 right?<br>What's
the proper way to fit speex_echo_capture() and speex_echo_playback()
into the following procedures, assuming they were already wrapped by
jni properly?<br><br> <span style="font-family: Courier New,Courier,Monospace;">speexInit();</span><br><span style="font-family: Courier New,Courier,Monospace;"> final PcmRecorder r = new PcmRecorder();<br> final PcmPlayer p = new PcmPlayer();<br> r.setListener(new RecorderListener() {<br><br> public void recorded(Object source, byte[] bytes, int length) {<br> // WHEN A FRAME IS CAPTURED, THIS CALLBACK WILL BE TRIGGERED<br><br> int c = speexEncode(bytes);<br> // this is just for local playback, a demo only<br> speexDecode(bytes, c);<br> p.write(bytes, 0, length); // THIS IS WHERE A FRAME WAS WRITTEN FOR PLAYBACK<br> }<br> <br> });<br> p.start();<br> r.start();<br> Runtime.getRuntime().addShutdownHook(new Thread() {<br> public void run() {<br> speexDestroy();<br> }<br> });</span><br /><hr />Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! <a href='http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us' target='_new'>Try it!</a></body>
</html>