I am new to android development. I am just trying to record an audio with android studio(2.1.1) testing with 6.0.1 Marshmallow device.
public class MainActiv
Query: getting error setaudiosource failed
Answer: follow the instruction. declare the permission in AndroidMainfest.xml, if you are working on Marshmallow and above then following the below lines.
requestPermissions(new String[]{
Manifest.permission_group.STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO,
} `enter code here`