How to shut off the sound MediaRecorder plays when the state changes

前端 未结 5 1753
自闭症患者
自闭症患者 2020-12-23 23:20

My Android application uses MediaRecorder on a SurfaceHolder to show a live preview of what the camera is capturing. Every time the user presses the REC button on the app, t

5条回答
  •  感情败类
    2020-12-24 00:10

    try

    ((AudioManager)context.getSystemService(Context.AUDIO_SERVICE)).setStreamMute(AudioManager.STREAM_SYSTEM,true);
    

    That mute all sounds.

提交回复
热议问题