AgateLib.AudioLib.SoundBuffer Class Reference

A class which is used for loading and playing of sounds. Typically this is used for sound effects, whereas playing background music is done by the Music class. More...

List of all members.

Public Member Functions

 SoundBuffer (string filename)
 Constructs a SoundBuffer object, loading audio data from the specified file.
 SoundBuffer (IFileProvider fileProvider, string filename)
 Constructs a SoundBuffer object, loading audio data from the specified file given the specified IFileProvider.
 SoundBuffer (Stream source)
 Constructs a SoundBuffer object, loading audio data from the passed stream.
void Dispose ()
 Disposes of the SoundBuffer object, and all SoundBufferSession objects created by this SoundBuffer.
SoundBufferSession CreateSession ()
 Creates a SoundBufferSession object, for playing of this buffer.
SoundBufferSession Play ()
 Creates a SoundBufferSession object and starts it playing. You can ignore the return value of this function if you just want simple playback.
void Stop ()
 Stops all SoundBufferSession objects created from this sound.

Properties

SoundBufferImpl Impl [get]
 Returns the implemented object.
string Filename [get]
 Filename this sound was originally loaded from.
double Volume [get, set]
 Gets or sets the default volume that will be used in new sessions. Range is: 0.0 Quiet 0.5 Sounds half volume 1.0 Full volume.
double Pan [get, set]
 Gets or sets the left-right balance that will be used in new sessions. -1 is entirely in the left speaker, 0 is equally in both and, 1 is entirely in the right speaker.
bool IsPlaying [get]
 Returns true if any SoundBufferSession objects are playing.

Events

Audio.AudioCoreEventDelegate StopEvent
 Event which occurs when Stop is called on the SoundBuffer object.


Detailed Description

A class which is used for loading and playing of sounds. Typically this is used for sound effects, whereas playing background music is done by the Music class.

The SoundBuffer class supports playing the same sound multiple times; this is done through the creation of SoundBufferSession objects for each time the SoundBuffer is played.

SoundBufferSession objects may be recycled, to cut down on the amount of new calls.

This class should support loading of .wav files, at the very least.


Constructor & Destructor Documentation

AgateLib.AudioLib.SoundBuffer.SoundBuffer ( string  filename  ) 

Constructs a SoundBuffer object, loading audio data from the specified file.

Parameters:
filename 

AgateLib.AudioLib.SoundBuffer.SoundBuffer ( IFileProvider  fileProvider,
string  filename 
)

Constructs a SoundBuffer object, loading audio data from the specified file given the specified IFileProvider.

Parameters:
fileProvider 
filename 

AgateLib.AudioLib.SoundBuffer.SoundBuffer ( Stream  source  ) 

Constructs a SoundBuffer object, loading audio data from the passed stream.

Parameters:
source 


Member Function Documentation

SoundBufferSession AgateLib.AudioLib.SoundBuffer.CreateSession (  ) 

Creates a SoundBufferSession object, for playing of this buffer.

Returns:

void AgateLib.AudioLib.SoundBuffer.Dispose (  ) 

Disposes of the SoundBuffer object, and all SoundBufferSession objects created by this SoundBuffer.

SoundBufferSession AgateLib.AudioLib.SoundBuffer.Play (  ) 

Creates a SoundBufferSession object and starts it playing. You can ignore the return value of this function if you just want simple playback.

Returns:

void AgateLib.AudioLib.SoundBuffer.Stop (  ) 

Stops all SoundBufferSession objects created from this sound.


Property Documentation

string AgateLib.AudioLib.SoundBuffer.Filename [get]

Filename this sound was originally loaded from.

SoundBufferImpl AgateLib.AudioLib.SoundBuffer.Impl [get]

Returns the implemented object.

bool AgateLib.AudioLib.SoundBuffer.IsPlaying [get]

Returns true if any SoundBufferSession objects are playing.

double AgateLib.AudioLib.SoundBuffer.Pan [get, set]

Gets or sets the left-right balance that will be used in new sessions. -1 is entirely in the left speaker, 0 is equally in both and, 1 is entirely in the right speaker.

double AgateLib.AudioLib.SoundBuffer.Volume [get, set]

Gets or sets the default volume that will be used in new sessions. Range is: 0.0 Quiet 0.5 Sounds half volume 1.0 Full volume.


Event Documentation

Audio.AudioCoreEventDelegate AgateLib.AudioLib.SoundBuffer.StopEvent

Event which occurs when Stop is called on the SoundBuffer object.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo