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.


    How to recording voice and stream process

    Pythonista
    9
    13
    9891
    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.
    • mikashkin
      mikashkin last edited by

      You can using objc bindings. Probably outdated example was made by @omz some time ago. You can try this gist Record Audio Pythonista example.

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

        Thanks.
        But this code just record to a file. I need to stream to a server or using voice data to draw some graphics real time.

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

          According to Apple documentation:

          NSUrl object represents a URL that can potentially contain the location of a resource on a remote server, the path of a local file on disk, or even an arbitrary piece of encoded data.

          Probably there is some way to bend output to server, or just read file and route stream by yourself.

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

            You would need to have a streaming format in mind. What is it you want to achieve? Do you want the end result to be a file you can play back? Or do you want to somehow livestream to
            other people?

            NSUrl simply contains a url, a network address. it is basically just a fancy string.

            If you just want a file in the end, then you would basicslly use omz's example, then upload the resulting file to a server. For some sort of livestrsm, you will need to research formats/protocols and figure how to transform audio units into the right format.

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

              I wrote some code a while back showing how to draw a waveform based on real time audio input.

              https://github.com/jsbain/audiovis/blob/master/audiovis.py
              I have not updated for py3, so run with the py2 interpreter.

              If I were to do this again, I would experiment with Audio Units, which calls a block on small chunks of waveform. As is, this basically writes to a file every second, reads it back in and displays it. I think I have overlapping recorders to minimize latency.

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

                Thanks.
                I try it in pythonista 3. (need add one line on code)

                      def __init__(self,dofft=False):
                         scene.Scene.__init__(self)	   # <<<<< add this line on pythonista 3
                

                But the speed it's not real time.

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

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • JerrySmith1021
                    JerrySmith1021 last edited by

                    This post is deleted!
                    cvp 1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @JerrySmith1021 last edited by

                      @JerrySmith1021 Read this topic

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

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • Miles_Gonzalez
                          Miles_Gonzalez last edited by

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • Bella Gorden
                            Bella Gorden last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB Forums | Contributors