Re: 5.1 Surround Sound with WMVHD files
- From: "David" <David@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Feb 2006 12:54:32 -0800
I just noticed that SetSpeakerConfig is a global setting that an application
shouldn't touch. Does this mean the system should automatically know that it
is a 5.1 stream and handle it (which doesn't happen with AudioBox but does
happen with MediaPlayer)?
What method to you think MediaPlayer is using to play the audio?
I'm using a Creative Labs USB external 5.1 sound system if that matters.
David
"David" wrote:
Thanks for your reply Chris. I've taken a look at the AudioBox code which is.
DirectShow based. It doesn't, by default, handle 5.1 audio and I've looked at
all the interfaces created with the filtergraph and there are no references
to 5.1 audio. In fact the only audio interface seems to be IBasicAudio which
only allows volume and balance adjustments.
Should I try to implement a solution around IDirectSound8 which has the
SetSpeakerConfig function? Do you know of any code samples that use
IDirectSound8? I also need to play back the video in the WMV file -- how
would you suggest that be handled?
David
"Chris P. [MVP]" wrote:
On Fri, 10 Feb 2006 17:37:03 -0500, Chris P. [MVP] wrote:
On Fri, 10 Feb 2006 07:47:30 -0800, David wrote:
I'm running into a lot of dead-ends regard 5.1 playback and hoping someone
can help. Here's what I've tried so far:
1) I've used DirectSoundCreate8 to get an interface pointer and then used
SetSpeakerConfig(DSSPEAKER_5POINT1); to set 5.1 and then let my video
playback code (based on PlayWnd) to play the video/audio and I only get
output from the front speakers. If there's something else I need to do
before playing back the video, please let me know what it is. Is there some
DirectShow call to enable discrete output that I'm missing? Do I need to
talk to the sound output devices through the FilterGraphs?
2) I've tried using the AudioPlay sample code in the SDK and dropping in the
high resolution audio code from MSDN to play 5.1 audio and I still get audio
primarily from the front but it seems to put some of it in the back but not
as it is in the original file. It seems to try to reallocate the sound mix
and I only get a faint mixed version of the real audio in the rear with most
of the rear audio coming out of the front speakers. Even if I get this
working, I don't know if I can render video using the Reader interface that
AudioPlay is based around. I modified AudioPlay code using SetOutputSetting
to set g_wszEnableDiscreteOutput to TRUE and g_wszSpeakerConfig to
DSSPEAKER_5POINT1.
My WMA/WMV files play perfectly under Windows Media Player with the audio
distributed as in our original mix and with the WMVHD video playing
perfectly. If it can be done by WMP then I would think I should be able to
do it somehow. Some example code would be very welcome.
If you are referring to the AudioPlayer sample in the Windows Media SDK it
does not use DirectSound at all, it uses the legacy winMM API. Sound cards
like SoundBlaster do not support multi-channel output with the winMM API.
You would have to modify all the waveout code in audioplay.cpp so that it
used DirectSound.
You can get a DirectSound reference code from an older DXSDK (Dec 2004) for
the StreamData sample or from my web site. You will have to change the
code that declares the WAVEFORMATEX so that it uses a WAVEFORMATEXTENSIBLE
instead when creating the secondary buffer, in addition to the
SetSpeakerConfig().
After further review of that AudioPlayer sample in the Format SDK it is
just a very bad sample and I would stay away. I think you would get
further with the AudioBox DirectShow sample, should be easier too if you
know a little DirectShow. DirectShow is part of the Platform SDK but for
easy reference to the samples you need the project files from here:
http://tmhare.mvps.org/downloads.htm
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
- Follow-Ups:
- Re: 5.1 Surround Sound with WMVHD files
- From: David
- Re: 5.1 Surround Sound with WMVHD files
- References:
- Re: 5.1 Surround Sound with WMVHD files
- From: Chris P. [MVP]
- Re: 5.1 Surround Sound with WMVHD files
- From: Chris P. [MVP]
- Re: 5.1 Surround Sound with WMVHD files
- Prev by Date: Re: Increased WMF latency after WMP Security Update
- Next by Date: How do I change the Encoder's user interface?
- Previous by thread: Re: 5.1 Surround Sound with WMVHD files
- Next by thread: Re: 5.1 Surround Sound with WMVHD files
- Index(es):
Relevant Pages
|