I have a sound file playing which lasts 50 seconds say. At 30 seconds, I need a new window to open and load a picture.
Would I be better off creating a new timer, when it hits 30 seconds, fire the new window or would I be better off creating a new thread, have the timer in the thread, fire at 30 seconds then kill the thread?
Or is there something I can just use in .NET which does this sort of thing (a special timer or something that latches onto the sound player.
I'm using the following to play the sound currently
Expand|Select|Wrap|Line Numbers
- [System.Runtime.InteropServices.DllImport("coredll.dll")]
- private static extern int PlaySound(byte[] szSound, int Mod, int flags);
- System.IO.Stream wav = _assembly.GetManifestResourceStream("h:\new.wav");
- Byte[] soundBytes = new Byte[wav.Length];
- wav.Read(soundBytes, 0, (int)wav.Length);
- int res=PlaySound(soundBytes, 0, 0x0005); //SND_MEMORY | SND_ASYNC
Paul