Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Playing Multiple Sounds with No Delay
  2. var dev = new Device();
  3.         dev.SetCooperativeLevel(this, CooperativeLevel.Priority);
  4.         MemoryStream ms = new MemoryStream(Sample1);
  5.         SecondaryBuffer sound = new SecondaryBuffer(ms, dev);
  6.  
  7.  
  8.         var dev1 = new Device();
  9.         dev1.SetCooperativeLevel(this, CooperativeLevel.Priority);
  10.         MemoryStream ms1 = new MemoryStream(Sample2);
  11.         SecondaryBuffer sound1 = new SecondaryBuffer(ms1, dev1);
  12.  
  13.         sound.Play(0, BufferPlayFlags.Default);
  14.         sound1.Play(0, BufferPlayFlags.Default);