Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xaudio2 and x3daudio Calculate DspSettings issue

146 views
Skip to first unread message

Richy

unread,
Apr 25, 2011, 1:31:59 AM4/25/11
to

Hi,

I'm trying to get the matrix coefficients calculated so that a sound
is positioned properly in 3D space, but I am getting no sound. By this
I mean that I am getting a 0 for the volume in all six speakers.

Dim emitter As X3DAudio.Emitter = New X3DAudio.Emitter

emitter.ChannelCount = 1
emitter.Position = New Vector3(0.0F, 0.0F, 0.0F) '
location
emitter.OrientFront = New Vector3(0.0F, 0.0F, 1.0F) '
front
emitter.OrientTop = New Vector3(0.0F, 1.0F, 0.0F) ' top
emitter.Velocity = Vector3.Zero

Main.Engine.Listener.Position = New Vector3(0.0F, 0.0F,
0.0F) ' location
Main.Engine.Listener.OrientFront = New Vector3(0.0F, 0.0F,
1.0F) ' front
Main.Engine.Listener.OrientTop = New Vector3(0.0F, 1.0F,
0.0F) ' top

Dim settings As X3DAudio.DspSettings =
Main.Engine.Audio3D.Calculate(Main.Engine.Listener, emitter,
X3DAudio.CalculateFlags.Matrix, 1, 6)
Dim m() As Single = settings.MatrixCoefficients

If I do the above, m has a result of

(0): 0.2
(1): 0.2
(2): 0.2
(3): 0.0
(4): 0.2
(5): 0.2

However, if I alter the emitter's position ever so slightly to the
right of the listener, say to new vector3(0, 0, 0.5f) I get a result
of

(0): 0.0
(1): 0.0
(2): 0.0
(3): 0.0
(4): 0.0
(5): 0.0


I can't for the life of me see what I am doing wrong, can you?

Richy

t.vi...@gmail.com

unread,
Aug 19, 2013, 3:34:43 PM8/19/13
to
I would be glad to know the solution of this problem.
Thierry

t.vi...@gmail.com

unread,
Aug 19, 2013, 3:37:14 PM8/19/13
to
I followed the documentation, and I really can't find why calculate will set the matric to 0 only. If positions of Listener and Emitter are the same, I get a good matrix with balanced index between right and left. Wi slighly different positions, only 0 matrix.

http://msdn.microsoft.com/en-us/library/windows/desktop/ee415798%28v=vs.85%29.aspx

Thierry
0 new messages