Pitch info from microphone


Last Updated:

  1. android88

    android88 Member This Topic's Starter

    Joined:
    Jan 6, 2010
    Messages:
    17
    Likes Received:
    0
    Hi, I want to make an app that reacts to the pitch of the voice of the user, but Im not sure how to do this. Is there a standard function for reading the pitch, or can I get the raw audo information some way and then calculate the pitch?

    Any suggestions of how to do this are appreciated :)

    Thanks.
     

    Advertisement
  2. markb

    markb Well-Known Member

    Joined:
    Sep 14, 2009
    Messages:
    148
    Likes Received:
    26
    Hi,

    There's no standard function that I know of.

    You'll need to record the audio, and then do some processing on the raw data you've captured. That processing will involve Fast Fourier Transformations (FFT). A mathematical way of working out what frequencies make up the signal. After all that it's still not a trivial task to identify a single frequency. Your signal will be made up of many frequencies, and it's not always easy to pick out the one you're after.

    You'll be able to find implementations of the FFT algorithm in various languages, including Java. I'd recommend adapting some existing code, unless you're particularly mathematically minded.

    I've written an app that tries to identify the frequency of a guitar string, and I didn't find it easy to get reliable results. Lower frequencies are particularly tricky to handle. I fear that it will be even trickier dealing with the human voice.

    Good luck with it.

    Mark
     
  3. android88

    android88 Member This Topic's Starter

    Joined:
    Jan 6, 2010
    Messages:
    17
    Likes Received:
    0
    Thanks very much! It seems that its not going to be as easy as I thought :p
    But at least I know how to proceed now :)
     
  4. markb

    markb Well-Known Member

    Joined:
    Sep 14, 2009
    Messages:
    148
    Likes Received:
    26

Share This Page

Loading...