|
|
|
date: Wed, 16 Jul 2008 14:11:01 -0700,
group: microsoft.public.win32.programmer.directx.audio
back
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
|
|