flash.media

# AudioPlaybackMode - AS3

Package | flash.media
Class | public final class AudioPlaybackMode
Inheritance | AudioPlaybackMode Object

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.0

The AudioPlaybackMode class defines constants for the `audioPlaybackMode` property of the SoundMixer class.

Known Issue: No audio is played in the Media Playback mode for StageVideo, when the mute switch is ON.

Each of these constants represents a set of behavior for audio on mobile tailored to a particular use.

Related API Elements

flash.media.Sound
flash.media.SoundMixer

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | AMBIENT : String = "ambient" [static] A mode for playing ambient sound. | AudioPlaybackMode
|  | MEDIA : String = "media" [static] A mode for playing media sounds. | AudioPlaybackMode
|  | VOICE : String = "voice" [static] A mode for playing voice audio. | AudioPlaybackMode

Constant Detail

### AMBIENT

Constant

`public static const AMBIENT:String = "ambient"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.4

A mode for playing ambient sound. Use this mode for playing sounds that are accompaniments to the actual purpose of the application and are not necessary for its successful use. When using this mode, audio is routed through the speakerphone. If headphones are plugged in, they override the speakerphone. The operating system uses defaults for ambient sound when deciding behavior and priority for audio.

This setting has no special effect on the desktop or TV.

On iOS, using this mode causes audio to be silenced by locking the screen (or sending the app to the background by any other means) and enabling the hardware Silent switch while the Microphone is not in use. If a Microphone is in use, audio is not affected by these actions.

Note:: Audio is not silenced by the Silent switch if a Headset is connected.

### MEDIA

Constant

`public static const MEDIA:String = "media"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.0

A mode for playing media sounds. When using this mode on mobile, sound is routed through the speakerphone. If headphones are plugged in they override the speakerphone. The operating system uses defaults for media audio when deciding behavior and priority for audio.

This setting has no special effect on the desktop or TV.

This is the default.

### VOICE

Constant

`public static const VOICE:String = "voice"`

Language Version: | ActionScript 3.0

Runtime Versions: | AIR 3.0

A mode for playing voice audio. When using this mode, audio is routed through the phone earpiece by default. If headphones are plugged in they override the earpiece. If the `SoundMixer.useSpeakerphoneForVoice` property is set, sound goes to the speakerphone, overriding the earpiece/headphones. The operating system uses defaults for voice audio when deciding behavior and priority for audio.

Try to minimize usage of `AudioPlaybackMode.VOICE`, and try to switch to `AudioPlaybackMode.MEDIA` as soon as possible after a voice call ends, which allows other applications to play in media mode.

This setting has no special effect on the desktop or TV.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00