Sign in to follow this  

XAudio2 - Simple Panning

This topic is 2494 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][color=#4A4A4A]

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


Thanks,
Halsafar[/color]

Share this post


Link to post
Share on other sites
Take a look at [url="http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.setoutputmatrix%28v=VS.85%29.aspx"]SetOutputMatrix[/url] this should allow you to specify different levels for the right and left channels on a given voice.

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.
[code]

float mat[] =
{
0, 1
};

pSourceVoice->SetOutputMatrix(NULL, 1, 2, mat);
[/code]

Thanks a bunch!

Share this post


Link to post
Share on other sites
[quote name='Halsafar' timestamp='1298055983' post='4776028']
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.
[code]

float mat[] =
{
0, 1
};

pSourceVoice->SetOutputMatrix(NULL, 1, 2, mat);
[/code]

Thanks a bunch!
[/quote]

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

This topic is 2494 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this