Example: AudioOutputControl MIDlet

The AudioOutputControl example MIDlet shows you how to use AudioOutputControl on a Symbian device to manage audio output modes for a variety of media players. The example MIDlet shows you how to:

  • Retrieve a list of all the audio output modes supported by the device

  • Set the audio output mode to the device loudspeaker (PUBLIC) or headset (PRIVATE)

  • Retrieve the current audio output mode

  • Retrieve the previous audio output mode set by the setOutputMode method

  • Receive notifications when the audio output mode changes

The example MIDlet is also configured to ignore automatic audio muting. If you want the example MIDlet to follow the default audio muting behavior, remove the Nokia-UI-Enhancement attribute from the file AudioOutputControlMidlet\dist\AudioOutputControlMidlet.jad and install the MIDlet using the modified file.

To use the example MIDlet on your Symbian device:

  1. Install and launch the MIDlet on the device.

  2. Create a player for one media type by selecting Options > Create [player].

  3. Start the media playback by selecting Options > Start playback.

  4. Set the audio output mode by selecting Options > Set mode [mode]. The MIDlet displays a notification when the audio output mode becomes active.

  5. Retrieve the currently used audio output mode by selecting Options > Get active mode. The MIDlet displays the name of the current audio output mode.

  6. Close the player by selecting Options > Close player.

  7. Repeat steps 2 through 6 for another media type.

  8. Exit the MIDlet.

Figure: Using the AudioOutputControl example MIDlet