Example usage for android.media AudioManager setMicrophoneMute

List of usage examples for android.media AudioManager setMicrophoneMute

Introduction

In this page you can find the example usage for android.media AudioManager setMicrophoneMute.

Prototype

public void setMicrophoneMute(boolean on) 

Source Link

Document

Sets the microphone mute on or off.

Usage

From source file:com.nbplus.vbroadlauncher.RealtimeBroadcastActivity.java

private void microphoneMute(boolean onoff) {
    AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    if (!audioManager.isMicrophoneMute() && onoff) {
        mIsMuted = true;// w  ww .ja  va2s  . c o m
        audioManager.setMicrophoneMute(onoff);
    } else if (!onoff) {
        audioManager.setMicrophoneMute(onoff);
    }
}