Adobe® AIR® API Reference for HTML Developers
Home  |  Show Classes List |  Index  |  Appendixes

Language Reference only       
SoundMixer 
3D:
Context3D
Context3DBlendFactor
Context3DClearMask
Context3DCompareMode
Context3DProgramType
Context3DRenderMode
Context3DStencilAction
Context3DTextureFormat
Context3DTriangleFace
Context3DVertexBufferFormat
CubeTexture
IndexBuffer3D
Program3D
Stage3D
Texture
VertexBuffer3D
Air.net:
ServiceMonitor
SocketMonitor
URLMonitor
Air.update:
ApplicationUpdater
ApplicationUpdaterUI
DownloadErrorEvent
StatusFileUpdateErrorEvent
StatusFileUpdateEvent
StatusUpdateErrorEvent
StatusUpdateEvent
UpdateEvent
Data:
EncryptedLocalStore
SQLCollationType
SQLColumnNameStyle
SQLColumnSchema
SQLConnection
SQLError
SQLErrorEvent
SQLErrorOperation
SQLEvent
SQLIndexSchema
SQLMode
SQLResult
SQLSchema
SQLSchemaResult
SQLStatement
SQLTableSchema
SQLTransactionLockType
SQLTriggerSchema
SQLUpdateEvent
SQLViewSchema
Desktop:
Clipboard
ClipboardFormats
ClipboardTransferMode
DockIcon
Icon
InteractiveIcon
NativeApplication
NativeProcess
NativeProcessStartupInfo
NotificationType
SystemTrayIcon
Display:
BitmapData
NativeMenu
NativeMenuItem
Screen
Stage
StageDisplayState
StageQuality
Events:
ActivityEvent
AsyncErrorEvent
BrowserInvokeEvent
DataEvent
DatagramSocketDataEvent
DNSResolverEvent
DRMAuthenticateEvent
DRMStatusEvent
ErrorEvent
Event
EventDispatcher
FileListEvent
HTTPStatusEvent
InvokeEvent
InvokeEventReason
IOErrorEvent
LocationChangeEvent
MouseEvent
NativeProcessExitEvent
NetDataEvent
NetMonitorEvent
NetStatusEvent
OutputProgressEvent
ProgressEvent
SampleDataEvent
SecurityErrorEvent
ServerSocketConnectEvent
StatusEvent
StorageVolumeChangeEvent
TimerEvent
UncaughtErrorEvent
UncaughtErrorEvents
File:
File
FileMode
FileStream
StorageVolume
StorageVolumeInfo
Functions:
trace()
generateRandomBytes()
navigateToURL()
sendToURL()
Geom:
Matrix
Point
Rectangle
Media:
AudioDecoder
AudioPlaybackMode
H264Level
H264Profile
H264VideoStreamSettings
ID3Info
InputMediaStream
Microphone
MicrophoneEnhancedMode
MicrophoneEnhancedOptions
Sound
SoundChannel
SoundCodec
SoundLoaderContext
SoundMixer
SoundTransform
VideoCodec
VideoStatus
VideoStreamSettings
Native window:
NativeWindow
NativeWindowBoundsEvent
NativeWindowDisplayState
NativeWindowDisplayStateEvent
NativeWindowInitOptions
NativeWindowRenderMode
NativeWindowResize
NativeWindowSystemChrome
NativeWindowType
Net:
AAAARecord
ARecord
CertificateStatus
DatagramSocket
DNSResolver
FileFilter
InterfaceAddress
IPVersion
LocalConnection
MXRecord
NetConnection
NetMonitor
NetStreamAppendBytesAction
NetStreamMulticastInfo
NetworkInfo
NetworkInterface
ObjectEncoding
PTRRecord
ResourceRecord
Responder
SecureSocket
ServerSocket
SharedObject
SharedObjectFlushStatus
Socket
SRVRecord
URLLoader
URLLoaderDataFormat
URLRequest
URLRequestDefaults
URLRequestHeader
URLRequestMethod
URLStream
URLVariables
XMLSocket
Security:
ReferencesValidationSetting
RevocationCheckSettings
SignatureStatus
SignerTrustSettings
X500DistinguishedName
X509Certificate
XMLSignatureValidator
System:
Capabilities
Security
System
Updater
Ui:
Keyboard
KeyboardType
KeyLocation
Mouse
MouseCursorData
Utils:
Vector
ByteArray
Collator
CollatorMode
CompressionAlgorithm
CurrencyFormatter
CurrencyParseResult
DateTimeFormatter
DateTimeNameContext
DateTimeNameStyle
DateTimeStyle
Endian
HTMLLoader
HTMLPDFCapability
LastOperationStatus
LocaleID
NationalDigitsType
NumberFormatter
NumberParseResult
StringTools
Timer
window.runtime propertywindow.runtime.flash.media.SoundMixer
InheritanceSoundMixer Inheritance Object

Runtime Versions: AIR 1.0,

The SoundMixer class contains static properties and methods for global sound control in the application. The SoundMixer class controls embedded and streaming sounds in the application. it does not control dynamically created sounds (that is, sounds generated in response to a Sound object dispatching a sampleData event).



Properties
 PropertyDefined By
  audioPlaybackMode : String
[static] Specifies the audio playback mode of all Sound objects.
SoundMixer
  bufferTime : int
[static] The number of seconds to preload an embedded streaming sound into a buffer before it starts to stream.
SoundMixer
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  soundTransform : flash.media:SoundTransform
[static] The SoundTransform object that controls global sound properties.
SoundMixer
  useSpeakerphoneForVoice : Boolean
[static] Toggles the speakerphone when the device is in voice mode.
SoundMixer
Public Methods
 MethodDefined By
  
[static] Determines whether any sounds are not accessible due to security restrictions.
SoundMixer
  
computeSpectrum(outputArray:ByteArray, FFTMode:Boolean = false, stretchFactor:int = 0):void
[static] Takes a snapshot of the current sound wave and places it into the specified ByteArray object.
SoundMixer
 Inherited
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined.
Object
 Inherited
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
 Inherited
propertyIsEnumerable(name:String):Boolean
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
  
stopAll():void
[static] Stops all sounds currently playing.
SoundMixer
 Inherited
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
toString():String
Returns the string representation of the specified object.
Object
 Inherited
valueOf():Object
Returns the primitive value of the specified object.
Object
Property Detail

audioPlaybackMode

property
audioPlaybackMode:String

Runtime Versions:  3

Specifies the audio playback mode of all Sound objects. On mobile devices, this property sets sound priorities and defaults according to platform idioms. In desktop and TV environments, no functional difference exists between audio playback modes.

Valid values for this property are defined in the AudioPlaybackMode class.

The default value is AudioPlaybackMode.MEDIA.


Throws
ArgumentError — kInvalidParameterError

See also

bufferTime

property 
bufferTime:int

Runtime Versions: AIR 1.0,

The number of seconds to preload an embedded streaming sound into a buffer before it starts to stream. The data in a loaded sound, including its buffer time, cannot be accessed by a SWF file that is in a different domain unless you implement a cross-domain policy file. For more information about security and sound, see the Sound class description.

The SoundMixer.bufferTime property only affects the buffer time for embedded streaming sounds in a SWF and is independent of dynamically created Sound objects (that is, Sound objects created in ActionScript). The value of SoundMixer.bufferTime cannot override or set the default of the buffer time specified in the SoundLoaderContext object that is passed to the Sound.load() method.

See also

soundTransform

property 
soundTransform:flash.media:SoundTransform

Runtime Versions: AIR 1.0,

The SoundTransform object that controls global sound properties. A SoundTransform object includes properties for setting volume, panning, left speaker assignment, and right speaker assignment. The SoundTransform object used in this property provides final sound settings that are applied to all sounds after any individual sound settings are applied.

See also

useSpeakerphoneForVoice

property 
useSpeakerphoneForVoice:Boolean

Runtime Versions:  3

Toggles the speakerphone when the device is in voice mode. By default, smartphones use the phone earpiece for audio output when SoundMixer.audioPlaybackMode is set to AudioPlaybackMode.VOICE. The useSpeakerphoneForVoice property lets you override the default output so that you can implement a speakerphone button in a phone application. This property has no effect in modes other than AudioPlaybackMode.VOICE. In desktop and TV environments, this property has no effect.

Note On Android, you must set the android.permission.MODIFY_AUDIO_SETTINGS in the AIR application descriptor or changing this value has no effect. In addition, the setting is global device setting. Other applications running on the device can change the underlying device setting at any time.

The default value is false.

See also

Method Detail

areSoundsInaccessible

()method
public function areSoundsInaccessible():Boolean

Runtime Versions: AIR 1.0,

Determines whether any sounds are not accessible due to security restrictions. For example, a sound loaded from a domain other than that of the content calling this method is not accessible if the server for the sound has no URL policy file that grants access to the domain of that domain. The sound can still be loaded and played, but low-level operations, such as getting ID3 metadata for the sound, cannot be performed on inaccessible sounds.

For AIR application content in the application security sandbox, calling this method always returns false. All sounds, including those loaded from other domains, are accessible to content in the application security sandbox.

Returns
Boolean — The string representation of the boolean.

See also

computeSpectrum

()method 
public function computeSpectrum(outputArray:ByteArray, FFTMode:Boolean = false, stretchFactor:int = 0):void

Runtime Versions: AIR 1.0,

Takes a snapshot of the current sound wave and places it into the specified ByteArray object. The values are formatted as normalized floating-point values, in the range -1.0 to 1.0. The ByteArray object passed to the outputArray parameter is overwritten with the new values. The size of the ByteArray object created is fixed to 512 floating-point values, where the first 256 values represent the left channel, and the second 256 values represent the right channel.

Note: This method is subject to local file security restrictions and restrictions on cross-domain loading. If you are working with local files or sounds loaded from a server in a different domain than the calling content, you might need to address sandbox restrictions through a cross-domain policy file. For more information, see the Sound class description. In addition, this method cannot be used to extract data from RTMP streams, even when it is called by content that reside in the same domain as the RTMP server.

This method is supported over RTMP in Flash Player 9.0.115.0 and later and in Adobe AIR. You can control access to streams on Flash Media Server in a server-side script. For more information, see the Client.audioSampleAccess and Client.videoSampleAccess properties in Server-Side ActionScript Language Reference for Adobe Flash Media Server.

Parameters

outputArray:ByteArray — A ByteArray object that holds the values associated with the sound. If any sounds are not available due to security restrictions (areSoundsInaccessible == true), the outputArray object is left unchanged. If all sounds are stopped, the outputArray object is filled with zeros.
 
FFTMode:Boolean (default = false) — A Boolean value indicating whether a Fourier transformation is performed on the sound data first. Setting this parameter to true causes the method to return a frequency spectrum instead of the raw sound wave. In the frequency spectrum, low frequencies are represented on the left and high frequencies are on the right.
 
stretchFactor:int (default = 0) — The resolution of the sound samples. If you set the stretchFactor value to 0, data is sampled at 44.1 KHz; with a value of 1, data is sampled at 22.05 KHz; with a value of 2, data is sampled 11.025 KHz; and so on.

See also

stopAll

()method 
public function stopAll():void

Runtime Versions: AIR 1.0,

Stops all sounds currently playing.

>In Flash Professional, this method does not stop the playhead. Sounds set to stream will resume playing as the playhead moves over the frames in which they are located.

For more information related to security, see the Flash Player Developer Center Topic: Security.