com.nokia.mid.media
Interface AudioOutputControl

All Superinterfaces:
javax.microedition.media.Control

public interface AudioOutputControl
extends javax.microedition.media.Control

AudioOutputControl is an interface for setting application audio output mode.

The AudioOutputControl is a Global Control and will effect all players.

When the MIDlet which set the audio routing is finished with the audio change then it must set it back to DEFAULT.

Example:


Since: 1.4


Field Summary
static int ALL
          The ALL audio output mode.
static int DEFAULT
          The DEFAULT audio output mode.
static int NONE
          The NONE audio output mode.
static int PRIVATE
          The PRIVATE audio output mode.
static int PUBLIC
          The PUBLIC audio output mode.
 
Method Summary
 int[] getAvailableOutputModes()
          Get all supported audio output modes
 AudioOutput getCurrent()
          returns an AudioOutput object which consists Device Type and the mode of the audio output
 int getOutputMode()
          Get the currently set audio output mode.
 int setOutputMode(int mode)
          Sets the preferred audio output mode.
 

Field Detail

DEFAULT

static final int DEFAULT
The DEFAULT audio output mode.

No Preference. The audio routing is restored to the default value.

Value 0 is assigned to DEFAULT.

See Also:
Constant Field Values

ALL

static final int ALL
The ALL audio output mode.

Audio is routed to one public and one private output at the same time. The primary output method within public and private outputs is selected by the device and can change dynamically when external periphals are connected or disconnected by the user (see "public" and "private" for their priorities).

Value 1 is assigned to ALL.

See Also:
Constant Field Values

NONE

static final int NONE
The NONE audio output mode.

Audio is not routed to any output.

Value 2 is assigned to NONE.

See Also:
Constant Field Values

PRIVATE

static final int PRIVATE
The PRIVATE audio output mode.

Audio is routed to earpiece or wired / wireless(BT) headset if connected. If there are several private output methods available at the same time audio is routed to only one of those selected with following priority order 1) wired headset 2) wireless headset 3) earpiece.

Value 3 is assigned to PRIVATE.

See Also:
Constant Field Values

PUBLIC

static final int PUBLIC
The PUBLIC audio output mode.

Audio is routed to loudspeaker, wireless(BT) speakers or TV output. If there are several public output methods available at the same time audio is routed to only one of those selected with following priority order: to be defined.

Value 4 is assigned to PUBLIC.

See Also:
Constant Field Values
Method Detail

getAvailableOutputModes

int[] getAvailableOutputModes()
Get all supported audio output modes

Returns:
The currently supported output modes

getOutputMode

int getOutputMode()
Get the currently set audio output mode. This is the last audioOutputMode sent to setOutputMode or DEFAULT if none has been set.

This does not return the actual audio output mode of the device. The AudioOutput can be used to provide the actual audio output mode.

Returns:
The last audio output mode which was sent to setOutputMode.

getCurrent

AudioOutput getCurrent()
returns an AudioOutput object which consists Device Type and the mode of the audio output


setOutputMode

int setOutputMode(int mode)
Sets the preferred audio output mode.

This will effect all players.

Parameters:
mode - one of the supported input modes
Returns:
audio output mode set or -1 if unable to set
Throws:
java.lang.IllegalArgumentException - with message "audio output mode is not valid" when the audio output mode is not valid
java.lang.IllegalStateException - with message "Accessory connected" if unable to change the audio routing due to an accessory connected
java.lang.SecurityException - with message "Permission denied" if the called does not have permission to control the audio routing.


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.