954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Play several Wave files

Hi

Does anyone know how to playing a set of short WAV files without delay?

I was using the following, but there is a delay in-between.

PlaySound("a.wav",NULL,NULL);//PLAY WAV SOUND ONCE
PlaySound("b.wav",NULL,NULL);//PLAY WAV SOUND ONCE


or I need to concatnate a few sets of short WAV files into one descriptor so that I can play them smoothly without delay.
If so, how to?


Thanks in advance.

jjyuyujj
Newbie Poster
2 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Does your PlaySound() function also load the sound file into memory?

If it does then you should load them before then use that to just play them.

sfuo
Practically a Master Poster
656 posts since Jul 2009
Reputation Points: 164
Solved Threads: 99
 

do you mean that I need to load the several wave files (in this case, a.wav, b.wav) into the memory first.

then, I can playsound() on them without any delay?


I've tried to use SND_ASYNC parameter, i.e.

PlaySound("a.wav",NULL,SND_ASYNC);//PLAY WAV SOUND ONCE
PlaySound("b.wav",NULL,SND_ASYNC);//PLAY WAV SOUND ONCE

however, the result is b.wav is played when a.wav hasn't finished.

any help please?

jjyuyujj
Newbie Poster
2 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Everything he needs to know can be found by reading this page:
http://msdn.microsoft.com/en-us/library/dd743680(v=VS.85).aspx

pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: