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
-
Can I using pythonista to recording voice from mic,and stream it to a network server? (or process real time local).
-
You can using
objc
bindings. Probably outdated example was made by @omz some time ago. You can try this gist Record Audio Pythonista example. -
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. -
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.
-
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.
-
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.
-
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.
-
This post is deleted! -
This post is deleted! -
-
This post is deleted! -
This post is deleted! -
This post is deleted!