C# Класс 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.

Наследование: BrightIdeasSoftware.Animateable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
FileName string
Player SoundPlayer
ResourceName string
SystemSound SystemSound

Открытые методы

Метод Описание
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.

Описание методов

Audio() публичный Метод

Create an empty Audio object
public Audio ( ) : System
Результат System

Audio() публичный Метод

Creates an Audio object that will play the given system sound
public Audio ( SystemSound sound ) : System
sound SystemSound
Результат System

Audio() публичный Метод

Creates an Audio object that will play the given "wav" file
public Audio ( string fileName ) : System
fileName string
Результат System

FromResource() публичный статический Метод

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"
Результат Audio

Start() публичный Метод

Start the sound playing
public Start ( ) : void
Результат void

Stop() публичный Метод

Stop the sound
public Stop ( ) : void
Результат void

Tick() публичный Метод

Advance the audio and return if it is done.
public Tick ( long elapsed ) : bool
elapsed long
Результат bool

Описание свойств

FileName защищенное свойство

Gets or sets the name of the audio file that will be played.
protected string FileName
Результат string

Player защищенное свойство

protected SoundPlayer Player
Результат SoundPlayer

ResourceName защищенное свойство

protected string ResourceName
Результат string

SystemSound защищенное свойство

protected SystemSound SystemSound
Результат SystemSound