M
Mark
The subject says it all really, but to emphasise that I don't wan't to play
WAVs (too big: MP3 or WMA would be better) and the sound file must be
embedded. Also, I want to ensure that the executable is a stand-alone. (That
is, it isn't accompanied by COM dlls, for example. This may sound a bit mad,
but it has to be implemented as a single file - please don't ask why. )
I've trawled through the Internet for this and come up with:
1. Use PlaySound from winmm.dll. AFAICT, this only plays WAV files, so no
good there. certainly, I could only get it to work with WAV files.
2. Use mciSendString from winmm.dll. Again, AFAICT, this does play other
format, but can't play embedded sound files. (Well, all the samples I've
seen open up files from the file system. I've spent a long time playing with
mciSendString to no avail.)
3. Use the Media Player control. This is implemented as a COM control - very
feature-rich, one - but I end up having to cart a couple of WMP dlls around
with me.
4. Write my own managed code to convert the embedded WMA to WAV on-the-fly
and then use PlaySound to play the file. Pheweee! If this is the only
option, I'm bailing out now because this isn't a trivial task.
I kind of think that there must be an easy way to do this, but I just can't
see how. Any idea?
TIA
Mark
WAVs (too big: MP3 or WMA would be better) and the sound file must be
embedded. Also, I want to ensure that the executable is a stand-alone. (That
is, it isn't accompanied by COM dlls, for example. This may sound a bit mad,
but it has to be implemented as a single file - please don't ask why. )
I've trawled through the Internet for this and come up with:
1. Use PlaySound from winmm.dll. AFAICT, this only plays WAV files, so no
good there. certainly, I could only get it to work with WAV files.
2. Use mciSendString from winmm.dll. Again, AFAICT, this does play other
format, but can't play embedded sound files. (Well, all the samples I've
seen open up files from the file system. I've spent a long time playing with
mciSendString to no avail.)
3. Use the Media Player control. This is implemented as a COM control - very
feature-rich, one - but I end up having to cart a couple of WMP dlls around
with me.
4. Write my own managed code to convert the embedded WMA to WAV on-the-fly
and then use PlaySound to play the file. Pheweee! If this is the only
option, I'm bailing out now because this isn't a trivial task.
I kind of think that there must be an easy way to do this, but I just can't
see how. Any idea?
TIA
Mark