Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

XAudio2 - Simple Panning

This topic is 2711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[color=#4A4A4A]I have a complex audio synthesis system setup and tested using XAudio2. It has come time to implement simple panning (Left<->Right [-1,1]). I cannot find any information on this for XAudio2 aside from setting up XAudio2 for 3D audio. I am hoping there is a easier way but I can't find anyway to control pan directly. [color=#4A4A4A]

From all my research there is nothing short of going all out with Xaudio2 3D. Any help would be appreciated.


Thanks,
Halsafar

Share this post


Link to post
Share on other sites
Advertisement
This appears to work, my mono samples are played only on the right speaker with this setup. Change to 1, 0 to enable the left speaker only.

I am glad google is already picking up on this forum post. Very little info on this.


float mat[] =
{
0, 1
};

pSourceVoice->SetOutputMatrix(NULL, 1, 2, mat);


Thanks a bunch!

Share this post


Link to post
Share on other sites

This appears to work, my mono samples are played only on the right speaker with this setup. Change to 1, 0 to enable the left speaker only.

I am glad google is already picking up on this forum post. Very little info on this.


float mat[] =
{
0, 1
};

pSourceVoice->SetOutputMatrix(NULL, 1, 2, mat);


Thanks a bunch!


It is a shame there is so little on XAudio2. I'd love to hear more about your project if your willing.

Share this post


Link to post
Share on other sites
It is an open source project or at least will be when we are finished with it. I've already put the code under LGPL license I just haven't release it anywhere yet and the svn repo is private.

We call it granular synthesis. The library can be used to create real life sound effects based on some end point sound effects.

So a good example is a chalk board. We want our virtual chalk sounds to sound very much like real life. So we record some sound samples and create a sound space:
(light pressure, slow movement) x (hard pressure, slow movement) x (light pressure fast movement) x (hard pressure hard movement). You then feed those sound samples into the library creating a sound space (think of a square [0, 0], [1, 0], [0, 1], [1, 1]). When you want to play a sound effect you just add the library to play a sound and give it a point in the sound space and a length of time. The library will generate the appropriate sound effects. Works really well :)

Shoot me a PM if you want more info and I'd be happy to link you to the source on release.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!