[英]android: media recorder : start failed: -38
简介:如何检查某些其他应用中的录音是否已在后台运行。
详细信息:如果录音已在本机应用程序的后台运行:录音机。 现在我已经将录音作为我应用程序中的功能之一。
问题:当我尝试在我的应用程序中同时录制时,它会出错:
: E/MediaRecorder: start failed: -38
: E/MyApp: [1162][com.sec.MyApp.multimedia.RecordMyVoice]java.lang.IllegalStateException
: E/MyApp: at android.media.MediaRecorder.start(Native Method)
: E/MyApp: at com.sec.MyApp.multimedia.RecordMyVoice.doInBackground(RecordMyVoice.java:100)
RecordMyVoice.java中第100行的代码:
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFile(mFileName);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.prepare();
mRecorder.start(); //code at 100th line
但问题是因为已经在后台运行录音。 因此,如果它在其他应用程序中运行,有没有办法停止录音。
任何输入都会有很大的帮助。
我有相同的错误-38,我发现有另一个使用麦克风通过(AudioRecord)的后台服务,当禁用后台服务时,它工作。
检查文件路径,该目录必须存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.