Results 1 to 4 of 4

Thread: VB - Tone Recognition

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    VB - Tone Recognition

    Hello...

    I decided to share my research about tone recognition, so I made a quick project that does just that...

    It all started with this thread: http://www.vbforums.com/showthread.php?t=325457 , I wanted to recognize the buttons you press on the phone when dialing out. I wanted to keep a record of all calls comming in (caller id), and calls going out (when you call someone).

    I attached 2 projects, first "ToneRecognition.zip" is the actual tone recognition project, and "CreateSineWave.zip" is a project that creates wav files that make the same sound as when you press the buttons on the phone (since most of you probably won't be able to bring the sound from the phone line into your computer)

    So, first run the CreateSineWave project to create the wav files, then run the ToneRecognition program, double click on the wav files to play them so that the program can recognize them.

    I have a Pentium 4, 1.4 GHz, and it takes ~ 500 ms to recognize a buffer that is 100 ms, that means I need a computer that is 5 times faster !! to recognize all buffers...
    This program is made entirely in Visual Basic, and VB is very slow on loops, if you convert the code in C++ (wich I did), it will take ~ 10 ms to recognize the 100 ms sound...

    Before you try... don't record from the microphone, and put the phone's speaker close to the microphone to test this, it won't work, I've set up the program to recognize the sound when there is a 5% difference between the unrecognized sound to the recognized sound, and when you do it with the microphone it won't work, the diference is smaller than that. Just test with the wav files from the CreateSineWave project...
    Attached Files Attached Files

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: VB - Tone Recognition

    Since most people want to see this working fast, I made a C++ DLL where I converted the main function that does all the heavy work.

    I attached the new ToneRecognition.zip file, you have to put the SoundStuff.DLL in your SYSTEM32 folder, DON'T FORGET, otherwise you will get an error, and you probably will have to end task if you don't.

    I also attached the SoundStuff.zip, the C++ project, has only 2 functions, and VB is using only one of them...

    I tested for speed now, and it shows that it processes the buffer in 16 ms (a little more than what I have tested in the past), but still fast enough to process everything in real time, and without your CPU going 100% (like in VB)

    The time it takes to process is directly proportional to the sound frequency, for example if you listen music (obviously it won't recognize any tone from that), the time to process increases to ~ 50 ms (therefore your CPU usage also), that is because the music sounds are higher frequencies than the tones from the phone.

    Also, since this project does it fast (real time), you can try to test it with the microphone also, but you have to change the "acceptable" percentage from:
    If HighPercent > (AvgPercent + 0.05) Then ' 5%
    to
    If HighPercent > (AvgPercent + 0.01) Then ' 1%

    This line you will find at the end of AnalyzeBuffer function.
    I don't have a microphone around me right now to test if the 1% does the trick for when using the microphone, but I think that's how it was in the past when I was testing...

    Anyways... have fun with it...
    Attached Files Attached Files
    Last edited by CVMichael; Apr 26th, 2005 at 04:59 PM.

  3. #3
    New Member
    Join Date
    May 2007
    Posts
    1

    Post New here

    Hi, guys!
    How are you doing here?
    I'm New here.

  4. #4
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: VB - Tone Recognition

    Wrong thread for that particular post and a pretty big bump.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width