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
 /// <summary>
 /// Load a sound from a named resource.
 /// </summary>
 /// <param name="resourceName">The name of the resource including the trailing ".wav"</param>
 /// <remarks>To embed a wav file, simple add it to the project, and change "Build Action"
 /// to "Embedded Resource".</remarks>
 /// <see cref="http://msdn.microsoft.com/en-us/library/ms950960.aspx"/>
 public static Audio FromResource(string resourceName) {
     Audio sound = new Audio();
     sound.ResourceName = resourceName;
     return sound;
 }
 /// <summary>
 /// Add the given sound to the animation so that it begins to play the given
 /// number of ticks after the animation starts.
 /// </summary>
 /// <param name="startTick">When should  the sound begin to play?</param>
 /// <param name="sprite">The sprite that will appear</param>
 public void Add(long startTick, Audio sound) {
     this.AddControlBlock(new AnimateableControlBlock(startTick, sound));
 }
Example #3
0
 /// <summary>
 /// Add the given sound to the animation so that it begins to play the given
 /// number of ticks after the animation starts.
 /// </summary>
 /// <param name="startTick">When should  the sound begin to play?</param>
 /// <param name="sprite">The sprite that will appear</param>
 public void Add(long startTick, Audio sound)
 {
     this.AddControlBlock(new AnimateableControlBlock(startTick, sound));
 }