1
\$\begingroup\$

I'm currently working on an XNA game with C#. I've been looking into 3D Sounds recently as this is the next objective on my list. I've found several tutorials online and they don't work to the standards I'm after.

What I've found is that even when the player moves, the sounds don't or when the play looks around the sound doesn't change where it's being projected from in my earphones. (When I look at the sound source, I expect to hear it and in front of me, or if I have my left turned to it, then I expect to hear it on my left etc...)

My Code so far:

//Decleration
    private Cue cue;
    private AudioEmitter emitter = new AudioEmitter();
    private AudioListener listener = new AudioListener();
    private AudioEngine engine;
    private WaveBank waveBank;
    private SoundBank soundBank;
    private float angle = 0;

//load content
        engine = new AudioEngine("Content/music/footsteps/footsteps.xgs");
        waveBank = new WaveBank(engine, "Content/music/footsteps/Wave Bank.xwb");
        soundBank = new SoundBank(engine, "Content/music/footsteps/Sound Bank.xsb");

//update
                listener.Position = Vector3.Zero;
                emitter.Position = new Vector3(10, 10, 10);
                cue.Apply3D(listener, emitter);
                cue = soundBank.GetCue("pl_step1");
                cue.Apply3D(listener, emitter);
                cue.Play();

My code works fine in that the sounds are being played and I can hear them, they are just not realistic and so I'm asking if anyone could help me how I could make the sound move around so that it sounds like it does in real life. (If the source/emitter is on my left, the main sounds should be coming through my left earphone.)

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .