How to use the microphone on Android -
i have started develop first android app, , having hard time figuring out how start microphone , have listen, main feature of app.
i've searched android docs , can't find info on this.
thanks in advance.
maybe can (actually android docs):
audio capture
- create new instance of
android.media.mediarecorder. - set audio source using
mediarecorder.setaudiosource(). want usemediarecorder.audiosource.mic. - set output file format using
mediarecorder.setoutputformat(). - set output file name using
mediarecorder.setoutputfile(). - set audio encoder using
mediarecorder.setaudioencoder(). - call
mediarecorder.prepare()onmediarecorderinstance. - to start audio capture, call
mediarecorder.start(). - to stop audio capture, call
mediarecorder.stop(). - when done
mediarecorderinstance, callmediarecorder.release()on it. callingmediarecorder.release()recommended free resource immediately.
Comments
Post a Comment