AudioNodeEmitter Left and Right Pan

I use the UWP AudioGraph API to generate tones, as in the SDK example for creating audio. It works fine, but I'm trying to add panning. I can make him move completely to the left speaker, but not everything to the right. For instance,

leftEmitter = new AudioNodeEmitter(AudioNodeEmitterShape.CreateOmnidirectional(), AudioNodeEmitterDecayModel.CreateCustom(1, 1), AudioNodeEmitterSettings.DisableDoppler); leftEmitter.Position = new System.Numerics.Vector3(-1, 0, 0); leftEmitter.Gain = 1; frameInputNodeLeft = graph.CreateFrameInputNode(nodeEncodingProperties, leftEmitter); frameInputNodeLeft.AddOutgoingConnection(deviceOutputNode); 

This sets the position as x = -1, y = 0 and z = 0. It only leaves the left speaker, which is great, but vice versa

  leftEmitter.Position = new System.Numerics.Vector3(1, 0, 0); 

This comes out of both speakers, why is it? Maybe I misunderstand the coordinate system? I also use headphones, so I'm not mistaken where it comes from.

Nick.

PS: I'm also trying to pan in real time from left to right, I start from this position,

  leftEmitter.Position = new System.Numerics.Vector3(-100, 0, 10) 

And I add 0.1 to position X every time I render the frame, this leads to the fact that I hear all this in the left speaker, slowly moving to the right, BUT, it gets stuck right after half way, at least what it looks like . It will not be further.

Code example:

Go to Scenario 3 and press the Left button to listen to panning from left to right.

https://1drv.ms/u/s!AlN90gKdry3-s-42er4iVbAAjNL-mA

+5
source share

Source: https://habr.com/ru/post/1265924/


All Articles