1

I want to make an App using kivy and speechrecognition, so i ineed to get mic input. PyAudio doesn't support Android, and I have tried using audiostream, but that also doesn't seem to work. Can I somehow get audio input using Python on an Android device?

2 Answers 2

1
+50

You can use Kivy to write Android apps in Python.

Android provides an audio interface described here for Java/Kotlin.

The directions of how to wrap Android Java APIs using Pyjinius in Kivy is here.

You also could also use Plyer. As documented here the code would look something like:

from plyer.facades import Audio

Audio.start() # starts recording

Audio.stop() # stops recording

Audio.play() # plays recording
Sign up to request clarification or add additional context in comments.

Comments

0

You can use sl4a for getting the input

import sl4a
droid = sl4a.Android()
def listen():
   global result,error
   time.sleep(1)
   return droid.recognizeSpeech("Speak",None,None)[1]

1 Comment

Note on the site you linked: " this probject is no longer under active development"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.