C# Class BrightIdeasSoftware.Audio

Instances of this class allow sound to be played at specified points within a animation.

This class uses the SoundPlayer class internally, and thus can only handle system sounds and WAV sound files.

A sound that is already playing cannot be paused.

Inheritance: BrightIdeasSoftware.Animateable
Afficher le fichier Open project: ennerperez/ObjectListView Class Usage Examples

Protected Properties

Свойство Type Description
FileName string
Player SoundPlayer
ResourceName string
SystemSound SystemSound

Méthodes publiques

Méthode Description
Audio ( ) : System

Create an empty Audio object

Audio ( SystemSound sound ) : System

Creates an Audio object that will play the given system sound

Audio ( string fileName ) : System

Creates an Audio object that will play the given "wav" file

FromResource ( string resourceName ) : Audio

Load a sound from a named resource.

To embed a wav file, simple add it to the project, and change "Build Action" to "Embedded Resource".

Start ( ) : void

Start the sound playing

Stop ( ) : void

Stop the sound

Tick ( long elapsed ) : bool

Advance the audio and return if it is done.

Method Details

Audio() public méthode

Create an empty Audio object
public Audio ( ) : System
Résultat System

Audio() public méthode

Creates an Audio object that will play the given system sound
public Audio ( SystemSound sound ) : System
sound SystemSound
Résultat System

Audio() public méthode

Creates an Audio object that will play the given "wav" file
public Audio ( string fileName ) : System
fileName string
Résultat System

FromResource() public static méthode

Load a sound from a named resource.
To embed a wav file, simple add it to the project, and change "Build Action" to "Embedded Resource".
public static FromResource ( string resourceName ) : Audio
resourceName string The name of the resource including the trailing ".wav"
Résultat Audio

Start() public méthode

Start the sound playing
public Start ( ) : void
Résultat void

Stop() public méthode

Stop the sound
public Stop ( ) : void
Résultat void

Tick() public méthode

Advance the audio and return if it is done.
public Tick ( long elapsed ) : bool
elapsed long
Résultat bool

Property Details

FileName protected_oe property

Gets or sets the name of the audio file that will be played.
protected string FileName
Résultat string

Player protected_oe property

protected SoundPlayer Player
Résultat SoundPlayer

ResourceName protected_oe property

protected string ResourceName
Résultat string

SystemSound protected_oe property

protected SystemSound SystemSound
Résultat SystemSound