C# Class SwfDotNet.IO.Tags.DefineSoundTag

DefineSoundTag is used to define a sound that will be played when a given event occurs.

Three different types of object are used to play an event sound:

  • The DefineSoundTag object that contains the sampled sound.
  • A SoundInfo object that defines how the sound fades in and out, whether it repeats and also defines an envelope for more sophisticated control over how the sound is played
  • A StartSoundTag object that signals the Flash Player to begin playing the sound.

Five encoded formats for the sound data are supported:

  • NATIVE_PCM - uncompressed Pulse Code Modulated: samples are either 1 or 2 bytes. For two-byte samples the byte order is dependent on the platform on which the Flash Player is hosted. Sounds created on a platform which supports big-endian byte order will not be played correctly when listened to on a platform which supports little-endian byte order.
  • PCM - uncompressed Pulse Code Modulated: samples are either 1 or 2 bytes with the latter presented in Little-Endian byte order. This ensures that sounds can be played across different platforms.
  • ADPCM - compressed ADaptive Pulse Code Modulated: samples are encoded and compressed by comparing the difference between successive sound sample which dramatically reduces the size of the encoded sound when compared to the uncompressed PCM formats. Use this format whenever possible.
  • MP3 - compressed MPEG Audio Layer-3.
  • NELLYMOSER - compressed Nellymoser Asao format supporting low bit-rate sound for improving synchronisation between the sound and frame rate of movies.

This tag was introduced in Flash 1. Flash 3 added support for MP3 and the Nellymoser Asao format was added in Flash 6.

Inheritance: BaseTag, DefineTag
Afficher le fichier Open project: bladecoding/SwfExport Class Usage Examples

Méthodes publiques

Méthode Description
DecompileToFile ( string fileName ) : void

Decompiles to file.

DefineSoundTag ( ) : System

Creates a new DefineSoundTag instance.

DefineSoundTag ( ushort soundId, uint soundFormat, uint soundRate, uint soundSize, uint soundType, uint soundSampleCount, byte soundData ) : System

Creates a new DefineSoundTag instance.

FromFile ( ushort characterId, string fileName ) : DefineSoundTag

Construct a new DefineSoundTag object from a file. This method assigns file stream data and character Id, but not get audio file properties (as format, bitrate, etc.).

FromStream ( ushort characterId, Stream stream ) : DefineSoundTag

Construct a new DefineSoundTag object from a stream. This method assigns file stream data and character Id, but not get audio file properties (as format, bitrate, etc.).

GetSizeOf ( ) : int

Gets the size of.

ReadData ( byte version, BufferedBinaryReader binaryReader ) : void

see base class

Serialize ( XmlWriter writer ) : void

Serializes with the specified writer.

UpdateData ( byte version ) : void

see base class

Private Methods

Méthode Description
DecompileToStream ( Stream stream ) : void

Decompiles to stream.

Method Details

DecompileToFile() public méthode

Decompiles to file.
public DecompileToFile ( string fileName ) : void
fileName string Name of the file.
Résultat void

DefineSoundTag() public méthode

Creates a new DefineSoundTag instance.
public DefineSoundTag ( ) : System
Résultat System

DefineSoundTag() public méthode

Creates a new DefineSoundTag instance.
public DefineSoundTag ( ushort soundId, uint soundFormat, uint soundRate, uint soundSize, uint soundType, uint soundSampleCount, byte soundData ) : System
soundId ushort Sound id.
soundFormat uint Sound format.
soundRate uint Sound rate.
soundSize uint Size of the sound.
soundType uint Sound type.
soundSampleCount uint Sound sample count.
soundData byte Sound data.
Résultat System

FromFile() public static méthode

Construct a new DefineSoundTag object from a file. This method assigns file stream data and character Id, but not get audio file properties (as format, bitrate, etc.).
public static FromFile ( ushort characterId, string fileName ) : DefineSoundTag
characterId ushort Character id.
fileName string Name of the file.
Résultat DefineSoundTag

FromStream() public static méthode

Construct a new DefineSoundTag object from a stream. This method assigns file stream data and character Id, but not get audio file properties (as format, bitrate, etc.).
public static FromStream ( ushort characterId, Stream stream ) : DefineSoundTag
characterId ushort Character id.
stream Stream Stream.
Résultat DefineSoundTag

GetSizeOf() public méthode

Gets the size of.
public GetSizeOf ( ) : int
Résultat int

ReadData() public méthode

see base class
public ReadData ( byte version, BufferedBinaryReader binaryReader ) : void
version byte
binaryReader SwfDotNet.IO.Utils.BufferedBinaryReader
Résultat void

Serialize() public méthode

Serializes with the specified writer.
public Serialize ( XmlWriter writer ) : void
writer System.Xml.XmlWriter Writer.
Résultat void

UpdateData() public méthode

see base class
public UpdateData ( byte version ) : void
version byte
Résultat void