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.


    Is it possible to use the microphone to measure sound frequency?

    Pythonista
    4
    8
    5322
    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.
    • Joeyd987.py
      Joeyd987.py last edited by

      I am working on a sound visualizer and I'm at a dead end because I have no clue how to get access to the devices microphone. If I can how can I make it move bars and make a canvas or scene?

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

        There is currently no way to access the microphone.

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

          This only works in the Pythonista beta release https://gist.github.com/omz/9882a00abf59c6009fa4

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

            Also, I was not able to get it to record .wav, although admittedly I didn't try too hard. Wav would be needed in order to get data in order to do a frequency response.

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

              https://github.com/jsbain/audiovis.git

              Early experiments. Found the right settings to record uncompressed pcm waves. Simple ui to draw the wave every 1sec. Played around a tad with fft display, but this was not satisfying, in large part because of the 1second lag. This always crashes the second time it is run... No idea why.

              To do: look at more of a scrolling display, with buffered samples. Possibly fun with emitters or physics. Experiment with multiple recorder instances, which should be possible in theory, I think, and might allow for a more fluid experience.

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

                I've updated the above repo. by refactoring things to configure multiple simultaneous recorders, if is possible to get reasonably fast updates to drive a visualizer plot. This is now in a reasonably clean class interface too.

                I found that the way pythonista clears globals in the beta causes problems when rerunning a script. I need to release some ctypes objects before the references get deleted, but msg etc get deleted before the instance, so things don't get freed. My solution was to force deletion after the scene ends.

                I think there is a similar problem with sk scenes/views... If the scene ends without an error, rerunning the script causes pythonista to crash. The solution was to raise an error inside did_stop to force whatever resetting is going on. Not sure if this is for all scenes, say that use actions, or if this is specific to the way I'm doing things.

                Anyway... Microphone to scrolling display now works... Need to experiment with different ways to plot this... Are 8000 sprites faster than an 8000 point path?

                1 Reply Last reply Reply Quote 0
                • Joeyd987.py
                  Joeyd987.py last edited by

                  Unfortunately I'm using an iPad and I was gonna do this as a project so I can show up my teacher because he's an ass who thinks he's an expert. (we have to teach ourselves in class)

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

                    With the Pythonista Beta, the repo above works on ipad.

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