Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Wed, 16 Jul 2008 14:11:01 -0700,    group: microsoft.public.win32.programmer.directx.audio        back       


Interconnecting voices in XAudio2.   
I am trying to hook up multiple SourceVoices into one SubmixVoice. The 
SourceVoices can each have one or more channels. The SubmixVoice should treat 
each of these SourceVoice inputs a separate channels so the net effect is 
that the SubmixVoice will output as many channels as the total number of 
channels in its inputs.

As a simple case, I've connected two mono-channel SourceVoices to a 
2-channel SubmixVoice which then connects to a 2-channel MasterVoice. What I 
expected to hear was one of the SourceVoices on the left channel with the 
other one on the right channel. What I got was a mixing of both SourceVoices 
on both output channels.

I then tried to manipulate the channel volumes of the SubmixVoice to direct 
one input to one output channel and the other input to the other output. What 
I got was that I could turn off both sources on one output only if both 
volume levels for that output were set to 0.

My conclusion is that the input channels to the SubmixVoice are being mixed 
before the audio reaches the output matrix. How can I keep it from doing this?

BTW, I instrumented the code to look at the volume settings for the 
SourceVoices and the SubmixVoice. When I change the volume setting for the 
SubmixVoice, both of the volume settings for the two SourceVoices go to 
extremely large values. When I run it again, I get even more zeroes in the 
number. I run it again, and both settings now show 0, but they should be at 
1.0 for all these runs.

I've also tried using SetChannelVolumes of the SubmixVoices. It is 
successful in controlling the volume to the left and right outputs, but the 
two inputs are still mixed on that output.
date: Wed, 16 Jul 2008 14:11:01 -0700   author:   Al Thorpe Al

RE: Interconnecting voices in XAudio2.   
I was able to figure out how to expand the number of channels. Part of the 
solution was realizing that all inputs to a voice are mixed equally based on 
the number of channels in each input. Also, XAudio2 does default mapping of 
its input(s) to the destination's input(s). This default behavior was causing 
the two mono source voices to each output two channels with its input applied 
to both channels. When the submix voice received the two inputs, it 
automatically mixed them together, resulting in both mono streams being 
placed on both the left and right outputs.

The solution was to define an output matrix for each source voice, 
overriding the default behavior. In this matrix I applied a volume of 1.0 for 
one channel and 0.0 for the other channel. Each source voice had these 
numbers reversed for each channel: one source voice output to the left 
channel, the other to the right channel. I now hear the one channel in one 
ear and the other channel in the other ear.

Al

"Al Thorpe" wrote:

> I am trying to hook up multiple SourceVoices into one SubmixVoice. The 
> SourceVoices can each have one or more channels. The SubmixVoice should treat 
> each of these SourceVoice inputs a separate channels so the net effect is 
> that the SubmixVoice will output as many channels as the total number of 
> channels in its inputs.
> 
> As a simple case, I've connected two mono-channel SourceVoices to a 
> 2-channel SubmixVoice which then connects to a 2-channel MasterVoice. What I 
> expected to hear was one of the SourceVoices on the left channel with the 
> other one on the right channel. What I got was a mixing of both SourceVoices 
> on both output channels.
> 
> I then tried to manipulate the channel volumes of the SubmixVoice to direct 
> one input to one output channel and the other input to the other output. What 
> I got was that I could turn off both sources on one output only if both 
> volume levels for that output were set to 0.
> 
> My conclusion is that the input channels to the SubmixVoice are being mixed 
> before the audio reaches the output matrix. How can I keep it from doing this?
> 
> BTW, I instrumented the code to look at the volume settings for the 
> SourceVoices and the SubmixVoice. When I change the volume setting for the 
> SubmixVoice, both of the volume settings for the two SourceVoices go to 
> extremely large values. When I run it again, I get even more zeroes in the 
> number. I run it again, and both settings now show 0, but they should be at 
> 1.0 for all these runs.
> 
> I've also tried using SetChannelVolumes of the SubmixVoices. It is 
> successful in controlling the volume to the left and right outputs, but the 
> two inputs are still mixed on that output.
date: Thu, 17 Jul 2008 11:11:06 -0700   author:   Al Thorpe

Re: Interconnecting voices in XAudio2.   
On Thu, 17 Jul 2008 11:11:06 -0700, Al Thorpe wrote:

> I was able to figure out how to expand the number of channels. Part of the 
> solution was realizing that all inputs to a voice are mixed equally based on 
> the number of channels in each input. Also, XAudio2 does default mapping of 
> its input(s) to the destination's input(s). This default behavior was causing 
> the two mono source voices to each output two channels with its input applied 
> to both channels. When the submix voice received the two inputs, it 
> automatically mixed them together, resulting in both mono streams being 
> placed on both the left and right outputs.
> 
> The solution was to define an output matrix for each source voice, 
> overriding the default behavior. In this matrix I applied a volume of 1.0 for 
> one channel and 0.0 for the other channel. Each source voice had these 
> numbers reversed for each channel: one source voice output to the left 
> channel, the other to the right channel. I now hear the one channel in one 
> ear and the other channel in the other ear.

Thanks for following up with your solution.

-- 
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
date: Mon, 28 Jul 2008 11:30:28 -0400   author:   Chris P.

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us