Discussion:
MCI error 261 when trying MCISendString to WAV sound
(too old to reply)
Consultant_Sweden
2006-10-31 12:17:01 UTC
Permalink
i.

I have a C++ application that uses MCIWnd objects to play media files of
various types. With MCIWNdSendString (or MCISendString) you can controll the
media playback and properties. Since I, in my application, only want the
sound to go to a specific audio channel I've been using the "setaudio left
off" command. This works perfectly for most media file types (mp3, wma, wmv,
avi, mpg, etc) but not with any kind of WAV sound. Any MCIWndSendString
operation made on a MCIWnd object that contains a WAV sound returns a 261 MCI
error, which states:

"The driver cannot recognize the specified command"

Why is this, and what can I do to avoid it?

Best regards, Andy.
a***@aol.com
2006-10-31 15:41:26 UTC
Permalink
Post by Consultant_Sweden
i.
I have a C++ application that uses MCIWnd objects to play media files of
various types. With MCIWNdSendString (or MCISendString) you can controll the
media playback and properties. Since I, in my application, only want the
sound to go to a specific audio channel I've been using the "setaudio left
off" command. This works perfectly for most media file types (mp3, wma, wmv,
avi, mpg, etc) but not with any kind of WAV sound. Any MCIWndSendString
operation made on a MCIWnd object that contains a WAV sound returns a 261 MCI
"The driver cannot recognize the specified command"
Why is this, and what can I do to avoid it?
My copy of MSDN says of "set audio left/right on/off" ...

"Disables or enables output to either the left or the right audio
channel. Video-overlay devices, the MCISEQ sequencer, and the MCIWAVE
waveform-audio device do not support this flag."

Alan Lloyd
Consultant_Sweden
2006-10-31 15:52:02 UTC
Permalink
Hi Alan.

Thank you for your response. If that's what MSDN documentation states then
I guess I have to find another way to pan the sound for WAV files. Is there
any walkaround? Or do I have to start looking on a DirectSound based
solution?

Best regards, Andy.
Chris P. [MVP]
2006-10-31 17:54:41 UTC
Permalink
Post by Consultant_Sweden
Thank you for your response. If that's what MSDN documentation states then
I guess I have to find another way to pan the sound for WAV files. Is there
any walkaround? Or do I have to start looking on a DirectSound based
solution?
You can use DirectShow and get the IBasicAudio interface from the renderer
to set the pan (balance). It doesn't take a lot of code and it is what MCI
is using to play the wave files behind the scenes anyway. DirectShow is
part of the Platform SDK but there is more samples in the older Summer 2004
DirectX SDK. A good example for you would be the "AudioBox" sample.

DirectSound is also an option but it doesn't have any file support, or
decoding support so you have to deal with that in other ways.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
Consultant_Sweden
2006-10-31 19:43:01 UTC
Permalink
Ok Chris, good stuff. Thanks. I'll look into the DirectShow.

Does anyone know why certain media doesn't work with MCI?

/Andy
Consultant_Sweden
2006-10-31 19:46:02 UTC
Permalink
Ok Chris. Good stuff, thanks. I'll look into the DirectShow.

Does anyone know why certain media types aren't supported with MCI?

/Andy
Chris P. [MVP]
2006-11-03 14:33:49 UTC
Permalink
Post by Consultant_Sweden
Ok Chris. Good stuff, thanks. I'll look into the DirectShow.
Does anyone know why certain media types aren't supported with MCI?
MCI is old and hasn't been updated for a long time. In general however,
anything that can be played in DirectShow should be playable with MCI.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
Chris P.
2006-12-01 13:38:45 UTC
Permalink
I just wanted to let you know that I went with the DirectShow solution.
Thanks for letting us know.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
Loading...