6

I am getting error like start recording() called uninitialized audio recording in android 2.3.4 version mobile(LG),its working fine in android 2.2 but throwing error in android 2.3.

sravanthi
  • 183
  • 1
  • 3
  • 9

2 Answers2

17

Also, make sure that you have this permission set in your AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

Michael Litvin
  • 3,662
  • 1
  • 29
  • 38
0

I am answering this question too late. May be my answer help other developers in future. Since Android 6.0 Marshmallow, application will not be granted any permission at installation time. Application has to ask user for a permission at run time. Permission request dialog will not launch automatically developer has to call for it manually after checking if permissions are given or not. In above case developer has to ask for android.permission.RECORD_AUDIO permission at run time. And also for android.permission.WRITE_EXTERNAL_STORAGE if saving recording to external storage. Also add to manifest as

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!--Audio Record Permission-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

Hope it will help some dev out.

Rahul Sharma
  • 10,599
  • 6
  • 19
  • 30