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.
Speech Recognition in Pythonista
-
Is there anyway to create speech recognition in pythonista? I know I can use the Google Speech Recognition API, but I would prefer no internet. Also, if you have an alternative to pyaudio I can use, that would be helpful. I am trying to create a python shell, but purely conversation, no typing.
-
There is no way to directly talk to the microphone, but if you understand the concepts behind Cocoa and Objective-C, you might be able to use the
ctypes
module in the Pythonista beta (ask omz about getting invited to beta test via TestFlight on iOS 8) to access it by interfacing with Cocoa (at least I think it's Cocoa), which will, in turn, retrieve the sound data. -
@omz himself created a voice recorder in the latest version of Pythonista: https://gist.github.com/omz/9882a00abf59c6009fa4
So you have to get around the more difficult of voice recognition. Either you use Siri or Google, or you need some offline ressource working in Python. -
I dont have this "ctypes" module, is that coming out in an update? I guess I could use the Internet, and I know how to send to google, but how would I make a recording in the first place through Pythonista?
-
As far as I can tell, iOS does not provide any voice recognition Apis. So, you can record, and send to google, using the beta and ctypes. I also can't find any apps that have x-callback-urls for voice recognition. Currently, iOS does not let safari access the mic, so you are sort of out of luck for now, unless omz adds any external voice api
-
So I can't even record from the iPad?
-
@jb you can leave @omz a notice in the Pythonista 1.6 Beta thread to get added to the beta testing group. That gives you access to the beta and also ctypes.
-
Maybe, when will this new update be released?
-
We dont know. Only when it's stable, and unfortunately there is a big with the autocompletion which causes crashes...
But the beta exists since mid November and hasnt been rekeased as full update yet. -
Never mind, figured out how to do it. Siri API.
-
As far as I can tell, there is no official Siri api, although something may be planned for ios9... Did you actually figure out a way to use voice recognition without Internet?
-
The Speechrecognition package does not work because it depends on Pyaudio, which the A-series chips do not support. There is a way to do speech recognition, but only fixed length recordings. Also offline speech recognition is not in the same class as Google API.
-
You can take a look here. https://developer.apple.com/videos/play/wwdc2019/256/