i have a big issue and i need ur help genious guiders
i want to play sound in my application
a wav file after another using playsound api
but idont know wat flags i must use right
the code used
[DllImport("winmm.dll")]
private static extern bool PlaySound(string filename, int module, int snd_flg);
<blockquote class="FQ">
private const int SND_SYNC = 0x0000;
private const int SND_ASYNC = 0x0001;
private const int SND_NODEFAULT = 0x0002;
private const int SND_MEMORY = 0x0004;
private const int SND_LOOP = 0x0008;
private const int SND_NOSTOP = 0x0010;
private const int SND_PURGE = 0x40;
private const int SND_APPLICATION = 0x80;
private const int SND_NOWAIT = 0x00002000;
private const int SND_ALIAS = 0x00010000;
private const int SND_ALIAS_ID = 0x00110000;
private const int SND_FILENAME = 0x00020000;
<blockquote class="FQ"><div class="FQA">Quote:</div>PlaySound(Application.StartupPath + @"\wavs\patient_no.wav", 0, SND_SYNC );
for (int i = 0; i < wav_arr.Length - 1; i++)
{
PlaySound(Application.StartupPath + @"\wavs\" + wav_arr[i] + ".wav", 0, SND_SYNC);
}
PlaySound(Application.StartupPath + @"\wavs\go_to_lab.wav", 0, SND_SYNC | SND_NODEFAULT | SND_PURGE);
</blockquote>
</blockquote>
when i use async... the program doesn't stop >>like timers ,, but it returns only the last sound
and if i use sync the program stops till sound finished
how can i fix it
it's a problem wth flags
but dont know which will work just perfect an dont hang my app
thanx alot