机器人:媒体记录:启动失败:-38 [英] android: media recorder : start failed: -38

查看:1108
本文介绍了机器人:媒体记录:启动失败:-38的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简介:如何检查是否录音在后台在其他一些应用程序已经运行

Brief: How to check if voice recording is already running in background in some other app.

详细介绍:录音:如果录音是从本机应用程序的背景已经在运行。
现在我已经实现录音在我的应用程序的功能之一。

Detail: if voice recording is already running in background from native app: Voice recorder. Now I have implemented voice recording as one of feature in my application.

问题:当我在我的同时应用尝试记录,它提供了错误:

Problem: when i try recording in my app at the same time, it gives error :

  : 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)

code。在第100行RecordMyVoice.java:

Code at 100th line in RecordMyVoice.java:

    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

但问题是,因为已经录音在后台运行。
因此,有没有什么办法阻止录音如果在其他应用程序的运行。

But problem is because already voice recording is running in background. Therefore is there any way to stop voice recording if its running in some other app.

任何投入将有很大的帮助。

Any input would be of great help.

推荐答案

我有同样的错误-38,我发现存在通过(AudioRecord),禁用后台服务时使用的麦克风另一个后台服务,它的工作。

i've had the same Error -38, i found out that there is Another background service that uses the mic via (AudioRecord), when disabling the background service , it worked.

这篇关于机器人:媒体记录:启动失败:-38的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆