java.lang.RuntimeException: setAudioSource failed

后端 未结 8 2108
灰色年华
灰色年华 2021-01-01 15:13

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         


        
8条回答
  •  失恋的感觉
    2021-01-01 15:37

    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`
    

提交回复
热议问题