Richy
2011-04-25 05:31:59 UTC
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
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