omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Use microphone and speaker to get distance

    Pythonista
    measure microphone distance speakers
    2
    3
    2940
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • smiddleton
      smiddleton last edited by

      Hey guys,
      I’m not sure where to start with this, but here is the idea:
      I want to use the microphone and speakers on the iPhone to measure distance. The speakers send out a pulse, the microphone pics up the pulse, and tells you the output in feet or inches or something.

      The math is the easy part I think. What I can’t seem to find is where to start. Is there an API for the microphone and speakers? Any help is appreciated, thanks!
      SM

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        interesting idea.

        this will require some objc to be able to any sort of precision timing.
        there were some threads recently about high performance audio generation. we would need to incorporate mic input into those audiounits.

        The speed of sound is about 343 m/s or 13.5 inch per msec.
        so we need resolution of about 800 microsec to get one inch.
        the sample rate in the mic will be around 40kHz, maybe, so what you suggest might be feasible

        1 Reply Last reply Reply Quote 0
        • smiddleton
          smiddleton last edited by

          That’s good to know it’s feasible. Is there a way to do in Pythonista? Or is it going to need Objc? Within a few inches is fine for accuracy.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors