gazza67 said:
[...]
I am sort of surprised that this is so hard to do since stopping a
sound midway through and knowing when a sound has finished playing are
pretty basic things I would have thought.
They are pretty basic, I'd agree. But SoundPlayer is even more basic.
As near as I can tell, it really is only intended for extremely
simple "fire and forget" audio playback. Your initial stated goal is
achievable, but as you add more and more requirements, it's not
surprising to me that you're running into difficulty using the
SoundPlayer class.
I would also be interested in knowing how long a sound will take to
play before actually playing it, but I suppose that is asking a bit
much.
Well, from SoundPlayer yes. It's definitely not for that sort of thing.
I can see I may have to start wading through the winmm .... yawn.....
For what it's worth, you may find DirectX more suitable. DirectSound or
DirectShow would be appropriate, and there's even an existing
open-source .NET wrapper for DirectShow:
http://sourceforge.net/projects/directshownet/
I think either one (DShow or DSound) should provide enough functionality
to achieve the goals you've stated so far. Of course, if you have yet
more things you want to do, well...
Pete