Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Playing Multiple Wav Files Using Directsound without Delay
Hi, I need to play multiple wave files using directsound or any other method. My application is similar to this: http://msdn.microsoft.com/en-us/library/ms973091.aspx
, where i need to create beats. The problem is that when I play two or more sounds, there will be some delay between both files. The program provided in that link does not have any delays present when more than 1 file is played but I couldn't understand the coding since it is extremely difficult and im just a beginner. Is there a way to remove the delay completely? I am using the following method:
var dev = new Device();
MemoryStream ms = new MemoryStream(Sample1);
SecondaryBuffer sound = new SecondaryBuffer(@"C:1.wav", dev);
var dev1 = new Device();
MemoryStream ms1 = new MemoryStream(Sample2);
SecondaryBuffer sound1 = new SecondaryBuffer(@"C:3.wav", dev1);
var dev2 = new Device();
SecondaryBuffer sound2 = new SecondaryBuffer(@"C:VEE Bassdrum 012.wav", dev2);
I also converted the wavefiles to streams and played them using memorystream but the delay is the same.
0 · ·