Capture audio from android app
I am trying to capture audio from the app.
I use:
Intent intent = new Intent(开发者_Python百科MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, Constants.RESULT_UPLOAD_AUDIO);
As soon as I click the capture audio button, I am returned back to the app in onActivityResult(int requestCode, int resultCode, Intent data), where data is null.
It works fine for video:
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent,Constants.RESULT_UPLOAD_VIDEO);
I was facing the similar problem. I did the following as a work around and it works perfectly fine:
Invoking audio recorder and getting the resulting file
Hope this helps.
精彩评论