Example usage for android.media AudioManager ROUTE_ALL

List of usage examples for android.media AudioManager ROUTE_ALL

Introduction

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

Prototype

int ROUTE_ALL

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

Click Source Link

Document

Used for mask parameter of #setRouting(int,int,int) .

Usage

From source file:com.phonegap.AudioHandler.java

/**
 * Set the audio device to be used for playback.
 * // w  ww . ja v  a 2  s  .  c o m
 * @param output         1=earpiece, 2=speaker
 */
public void setAudioOutputDevice(int output) {
    AudioManager audiMgr = (AudioManager) this.ctx.getSystemService(Context.AUDIO_SERVICE);
    if (output == 2) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);
    } else if (output == 1) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);
    } else {
        System.out.println("AudioHandler.setAudioOutputDevice() Error: Unknown output device.");
    }
}

From source file:org.skt.runtime.additionalapis.AudioHandler.java

/**
 * Set the audio device to be used for playback.
 *
 * @param output         1=earpiece, 2=speaker
 *///  w  w  w .  j  av a  2s  .  c  o  m
@SuppressWarnings("deprecation")
public void setAudioOutputDevice(int output) {
    AudioManager audiMgr = (AudioManager) this.ctx.getSystemService(Context.AUDIO_SERVICE);
    if (output == 2) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);
    } else if (output == 1) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);
    } else {
        System.out.println("AudioHandler.setAudioOutputDevice() Error: Unknown output device.");
    }
}

From source file:com.commontime.cordova.audio.AudioHandler.java

/**
 * Set the audio device to be used for playback.
 *
 * @param output         1=earpiece, 2=speaker
 *//*ww  w.ja  v  a 2  s .  c  o m*/
@SuppressWarnings("deprecation")
public void setAudioOutputDevice(int output) {
    AudioManager audiMgr = (AudioManager) this.cordova.getActivity().getSystemService(Context.AUDIO_SERVICE);
    if (output == 2) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);
    } else if (output == 1) {
        audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);
    } else {
        System.out.println("AudioHandler.setAudioOutputDevice() Error: Unknown output device.");
    }
}