/// <summary> /// plays a sound in loop. /// </summary> /// <param name="e">Sound to play in loop</param> /// <returns>loopID assigned to the loop.</returns> public static int playInLoop(Sound e) { MemoryStream ms = e.getStream(); //Can cause out of memory exception. SecondaryBuffer buffer = new SecondaryBuffer(ms, device); buffer.Play(0, BufferPlayFlags.Looping); loops.Add(loopID, buffer); return loopID++; }
/// <summary> /// Plays sound. /// </summary> /// <param name="e">Sound to play</param> public static void play(Sound e) { MemoryStream ms = e.getStream(); SecondaryBuffer buffer = new SecondaryBuffer(ms, device); buffer.Play(0, BufferPlayFlags.Default); }