SoundItem object

 < Day Day Up > 

Inheritance Item object > SoundItem object

Availability

Flash MX 2004.

Description

The SoundItem object is a subclass of the Item object. It represents a library item used to create a sound. See also frame.soundLibraryItem and Item object.

Property summary for the SoundItem object

In addition to the Item object properties, the following properties are available for the SoundItem object:

Property

Description

soundItem.bitRate

A string that specifies the bit rate of a sound in the library. Available only for the MP3 compression type.

soundItem.bits

A string that specifies the bits value for a sound in the library that has ADPCM compression.

soundItem.compressionType

A string that specifies the compression type for a sound in the library.

soundItem.convertStereoToMono

A Boolean value available only for MP3 and Raw compression types.

soundItem.quality

A string that specifies the playback quality of a sound in the library. Available only for MP3 compression type.

soundItem.sampleRate

A string that specifies the sample rate for the audio clip.

soundItem.useImportedMP3Quality

A Boolean value; if TRue, all other properties are ignored and the imported MP3 quality is used.


soundItem.bitRate

Availability

Flash MX 2004.

Usage

soundItem.bitRate

Description

Property; a string that specifies the bit rate of a sound in the library. This property is available only for the MP3 compression type. Acceptable values are "8 kbps", "16 kbps", "20 kbps", "24 kbps", "32 kbps", "48 kbps", "56 kbps", "64 kbps", "80 kbps", "112 kbps", "128 kbps", and "160 kbps". Stereo sounds exported at 8 or 16 kbps are converted to mono. The property is undefined for other compression types.

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example displays the bitRate value in the Output panel if the specified item in the library has MP3 compression type:

alert(fl.getDocumentDOM().library.items[0].bitRate);

See also

soundItem.compressionType, soundItem.convertStereoToMono

soundItem.bits

Availability

Flash MX 2004.

Usage

soundItem.bits

Description

Property; a string that specifies the bits value for a sound in the library that has ADPCM compression. Acceptable values are "2 bit", "3 bit", "4 bit", and "5 bit".

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example displays the bits value in the Output panel if the currently selected item in the library has ADPCM compression type:

alert(fl.getDocumentDOM().library.items[0].bits);

See also

soundItem.compressionType

soundItem.compressionType

Availability

Flash MX 2004.

Usage

soundItem.compressionType

Description

Property; a string that specifies that compression type for a sound in the library. Acceptable values are "Default", "ADPCM", "MP3", "Raw", and "Speech".

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example changes an item in the library to compression type Raw:

fl.getDocumentDOM().library.items[0].compressionType = "Raw";

The following example changes a selected item's compression type to Speech:

fl.getDocumentDOM().library.getSelectedItems()[0].compressionType =   "Speech";

soundItem.convertStereoToMono

Availability

Flash MX 2004.

Usage

soundItem.convertStereoToMono

Description

Property; a Boolean value available only for MP3 and Raw compression types. Setting this to TRue converts a stereo sound to mono; false leaves it as stereo. For MP3 compression type, if soundItem.bitRate is less than 20 Kbps, this property is ignored and forced to TRue (see soundItem.bitRate).

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example converts an item in the library to mono, only if the item has MP3 or Raw compression type:

fl.getDocumentDOM().library.items[0].convertStereoToMono = true;

See also

soundItem.compressionType

soundItem.quality

Availability

Flash MX 2004.

Usage

soundItem.quality

Description

Property; a string that specifies the playback quality of a sound in the library. This property is available only for MP3 compression type. Acceptable values are "Fast", "Medium", and "Best".

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example sets the playback quality of an item in the library to Best, if the item has MP3 compression type:

fl.getDocumentDOM().library.items[0].quality = "Best";

See also

soundItem.compressionType

soundItem.sampleRate

Availability

Flash MX 2004.

Usage

soundItem.sampleRate

Description

Property; a string that specifies the sample rate for the audio clip. This property is available only for ADPCM, Raw, and Speech compression types. Acceptable values are "5 kHz", "11 kHz", "22 kHz", and "44 kHz".

NOTE

If you want to specify a value for this property, set soundItem.useImportedMP3Quality to false.


Example

The following example sets the sample rate of an item in the library to 5 kHz, if the item has ADPCM, Raw, or Speech compression type:

fl.getDocumentDOM().library.items[0].sampleRate = "5 kHz";

See also

soundItem.compressionType

soundItem.useImportedMP3Quality

Availability

Flash MX 2004.

Usage

soundItem.useImportedMP3Quality

Description

Property; a Boolean value. If TRue, all other properties are ignored and the imported MP3 quality is used.

Example

The following example sets an item in the library to use the imported MP3 quality:

fl.getDocumentDOM().library.items[0].useImportedMP3Quality = true;

See also

soundItem.compressionType

     < Day Day Up > 


    Developing Extensions for Macromedia Flash 8
    Developing Extensions for Macromedia Flash 8
    ISBN: 032139416X
    EAN: 2147483647
    Year: 2005
    Pages: 81

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net