I have just started to develop my first Android app, and I am having a hard time figuring out how to start the microphone and have it listen, which is a main feature of my app.
I've searched the Android docs and I can't find much info on this.
Thanks in advance.
Maybe this can help (actually from the Android docs):
Audio Capture
android.media.MediaRecorder
.MediaRecorder.setAudioSource()
. You will probably want to use MediaRecorder.AudioSource.MIC
.MediaRecorder.setOutputFormat()
.MediaRecorder.setOutputFile()
.MediaRecorder.setAudioEncoder()
.MediaRecorder.prepare()
on the MediaRecorder
instance.MediaRecorder.start()
.MediaRecorder.stop()
.MediaRecorder
instance, call MediaRecorder.release()
on it. Calling MediaRecorder.release()
is always recommended to free the resource immediately.or:
Android Audio Recording Tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With