At 02:22 AM 1/27/2009, Benny Prijono wrote: >On Tue, Jan 27, 2009 at 2:27 AM, David Clark ><<mailto:vdc1048 at tx.rr.com>vdc1048 at tx.rr.com> wrote: >Ok I see how to do most of it. As your posted suggestion for inband >dtmf detection points out, looking at mp3_writer.c wav_writer.c I can >see the audio is in a 16 bit array that is written out in either >case. My question is the basic one. >If you have port->buf[0] for example is that the frequency of the >audio at that point. In short how do I relate audio sample data to frequency? > > >FFT? Btw I thought you knew about this stuff and just looking for a >place to hook it to. If you don't know about this then that makes it two of us. No not knowing how to compute the frequency value was my primary problem in why I just didn't plug it in. But this does explain why PJSIP does not do inband dtmf. By FFT do you mean: <http://en.wikipedia.org/wiki//wiki/Fast_Fourier_transform>Fast Fourier transform (FFT) algorithm Another user suggested the Goertzel algorithm which has a detailed write up here: http://en.wikipedia.org/wiki/Goertzel_algorithm The sample dtmf detection code there does not go unnoticed. Ok I am off to do some digging on this. If I come up with something that works...it's yours... >I also notice wav_writer.cpp and mp3_writer.c have put_frame >functions that include a callback call if the function pointer if >set. Is there any >reason not to do this also in conference.c? Yea the put_frame in >conference.c does not have such a feature. > > >Not sure I understand this. The put_frame/get_frame callbacks are >part of pjmedia_port framework and all media ports including the >conference bridge have these. Yes the conference bridge has put_frame/get_frame...but the put_frame and get_frame for the conference bridge does NOT have a callback function which the others do. But now seeing the computational load required to come up with frequency, I think I favor a pseudo-recorder who's sole purpose is to make frequency data available. Start that when you are interested in such and DON'T run it on everything where you have no interest. >cheers > Benny > > >Thanks, >David Clark > > >_______________________________________________ >Visit our blog: http://blog.pjsip.org > >pjsip mailing list >pjsip at lists.pjsip.org >http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090129/2b192825/attachment.html>