I've already asked this question on the OpenTK forums but there doesn't seem to be anyone able to respond. (http://www.opentk.com/node/3638)
In OpenTK, I'm trying to get a balance value of -1 to 1 converted to the left/right audio channels. When 0 (default value) both sides should be at 100% gain. When 1 100% for right and 0% for left and the opposite for -1. I'm having a hard time trying to get this to work in OAL seeing as this is actually my first time working with it.
So far I've tried: After OAL initialization:
AL.DistanceModel(ALDistanceModel.LinearDistanceClamped);
For each new source:
AL.Source(SourceId, ALSourcef.MaxDistance, 1f);
AL.Source(SourceId, ALSourceb.SourceRelative, false);
For setting the balance:
float balance = 0f; //(-1f to 1f)
OpenTK.Vector3 position = new OpenTK.Vector3(balance, 0f, 0f);
AL.Source(SourceId, ALSource3f.Position, ref position);
This will make the audio go just above 100% on the left channel and 0% on the right for all negative values of balance and just above 100% right 0% left for all positive values, so I'm kinda stuck.
How should I go about doing this? Any help is appreciated!
Gr.Viller
BTW: This looks like a near-duplicate of the unanswered OpenAL 2d panning C++.