Forum Archive

How to recording voice and stream process

wolf71

Can I using pythonista to recording voice from mic,and stream it to a network server? (or process real time local).

mikashkin

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

wolf71

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.

mikashkin

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.

JonB

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.

JonB

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.

wolf71

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.

djsunRYZE

Hi guys can u help me too , sorry for offtop , can u recommend me some sound effects for my project ? I've found this sound pack https://www.lucidsamples.com/sound-effects-packs/297-1000-reverse-fx.html and need ur opinion .

JerrySmith1021

I'm not sure whether you can record voice via Pythonista. As I know, to record streams playing on the computer, you can use a third party program. AudFree Audio capture for windows is the best recorder can help you to record any sound playing on your PC and save it as MP3, then you will able to play them on other players freely.

cvp

@JerrySmith1021 Read this topic

rufily

For using pythonista to record voice from mic I don't know how to do that and I hadn't take a try of it. But I did tried to record radio and music from my computer via DRmare Music Recorder. If you just simply want to record music, you could take a try of it. Good luck.

Miles_Gonzalez

As for me, I try to record my favorite songs with the DRmare Audio Capture for Windows and then I upload the songs to Plex to streaming on any devices I have.

Bella Gorden

If you want to record the voice and stream process, you may make use of a third-party tool like Audio Capture. With its help, you can record any audio or streaming from any apps or webs.