Example usage for android.media AudioManager STREAM_DTMF

List of usage examples for android.media AudioManager STREAM_DTMF

Introduction

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

Prototype

int STREAM_DTMF

To view the source code for android.media AudioManager STREAM_DTMF.

Click Source Link

Document

Used to identify the volume of audio streams for DTMF Tones

Usage

From source file:Main.java

public static void setAudioManage(Context context) {
    AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    audioManager.setStreamMute(AudioManager.STREAM_SYSTEM, true);
    audioManager.setStreamMute(AudioManager.STREAM_MUSIC, true);
    audioManager.setStreamVolume(AudioManager.STREAM_ALARM, 0, 0);
    audioManager.setStreamVolume(AudioManager.STREAM_DTMF, 0, 0);
    audioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0, 0);
    audioManager.setStreamVolume(AudioManager.STREAM_RING, 0, 0);
}

From source file:org.noise_planet.noisecapture.CalibrationLinearityActivity.java

private int getAudioOutput() {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    String value = sharedPref.getString("settings_calibration_audio_output", "STREAM_RING");

    if ("STREAM_VOICE_CALL".equals(value)) {
        return AudioManager.STREAM_VOICE_CALL;
    } else if ("STREAM_SYSTEM".equals(value)) {
        return AudioManager.STREAM_SYSTEM;
    } else if ("STREAM_RING".equals(value)) {
        return AudioManager.STREAM_RING;
    } else if ("STREAM_MUSIC".equals(value)) {
        return AudioManager.STREAM_MUSIC;
    } else if ("STREAM_ALARM".equals(value)) {
        return AudioManager.STREAM_ALARM;
    } else if ("STREAM_NOTIFICATION".equals(value)) {
        return AudioManager.STREAM_NOTIFICATION;
    } else if ("STREAM_DTMF".equals(value)) {
        return AudioManager.STREAM_DTMF;
    } else {//from  w ww .  j  a  va  2  s .c o m
        return AudioManager.STREAM_RING;
    }
}

From source file:com.almalence.plugins.capture.video.VideoCapturePlugin.java

protected void muteAllSounds() {
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_ALARM, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_DTMF, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_MUSIC, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_RING, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_SYSTEM, true);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_VOICE_CALL, true);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_ALARM, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_DTMF, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_RING, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_SYSTEM, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_VOICE_CALL, 0, 0);

    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_ALARM, AudioManager.ADJUST_MUTE, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_DTMF, AudioManager.ADJUST_MUTE, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_MUTE, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_SYSTEM, AudioManager.ADJUST_MUTE, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).adjustStreamVolume(AudioManager.STREAM_VOICE_CALL, AudioManager.ADJUST_MUTE, 0);
}

From source file:com.almalence.plugins.capture.video.VideoCapturePlugin.java

protected void unmuteAllSounds() {
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_ALARM, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_DTMF, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_MUSIC, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_NOTIFICATION, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_RING, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_SYSTEM, false);
    ((AudioManager) ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE))
            .setStreamMute(AudioManager.STREAM_VOICE_CALL, false);

    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_ALARM, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_DTMF, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_RING, 0, 0);
    //      ((AudioManager)ApplicationScreen.instance.getSystemService(Context.AUDIO_SERVICE)).setStreamVolume(AudioManager.STREAM_SYSTEM, 0, 0);
}