ZlwAudioRecorder
ZlwAudioRecorder copied to clipboard
Android 10 录音失败
在Android 9或以下的设备录音没有问题,在Android 10上录音会提示录音失败
我查了相关文档https://developer.android.com/guide/topics/media/mediarecorder
注意:在搭载 Android 9(API 级别 28)或更高版本的设备上,在后台运行的应用将无法访问麦克风。因此,您的应用只在以下两种情况下才应录制音频:当其位于前台时,或者您在前台服务中添加了 MediaRecorder 实例时。
应该是录制使用了service的缘故,请问后续会优化适配Android10吗?
I had the same problem on the Android Q,but I found that it was because of the storage path is null;You can set the path of the folder with the Android Q storage permission ! I hope this can help you!
I had the same problem on the Android Q,but I found that it was because of the storage path is null;You can set the path of the folder with the Android Q storage permission ! I hope this can help you!
I have been set the storage path with "RecordManager.changeRecordDir(getCacheDir().getAbsolutePath()+"/")",so I think is not path‘ s problem
You need to adapt the Android Q storage path,because on Android Q the storage policy behavior has changed
------------------ 原始邮件 ------------------ 发件人: "vlc"<[email protected]>; 发送时间: 2020年6月19日(星期五) 中午11:07 收件人: "zhaolewei/ZlwAudioRecorder"<[email protected]>; 抄送: "赤枫孤雁"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [zhaolewei/ZlwAudioRecorder] Android 10 录音失败 (#44)
I had the same problem on the Android Q,but I found that it was because of the storage path is null;You can set the path of the folder with the Android Q storage permission ! I hope this can help you!
I have been set the storage path with "ecordManager.changeRecordDir(getCacheDir().getAbsolutePath()+"/")",so I think is not path‘ s problem
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
我在小米9Q 没有复现, 你们用的什么机型?
I have the same issue did anyone found the solution ?? , in Android 10 its not working
Android10以后不能写入在项目自有存储空间以外的地方,像你这个录音项目默认的存储路径,会写入失败
Actually, you can use "context.getExternalFilesDir(Environment.DIRECTORY_MUSIC)" in all Android Platforms.
我查了相关文档https://developer.android.com/guide/topics/media/mediarecorder
注意:在搭载 Android 9(API 级别 28)或更高版本的设备上,在后台运行的应用将无法访问麦克风。因此,您的应用只在以下两种情况下才应录制音频:当其位于前台时,或者您在前台服务中添加了 MediaRecorder 实例时。
应该是录制使用了service的缘故,请问后续会优化适配Android10吗?
一般录音也就是在前台吧?您的意思是说如果应用不可见的情况下录音会出问题吗?
application里添加 android:requestLegacyExternalStorage="true"
android 10以后录音没有声音,不知道什么问题