playing mono wav files on different channels (left/right)

Started by vrm, October 12, 2003, 20:58:05

Previous topic - Next topic

vrm

Hi there,

I try to play a mono wav file on the left channel and a second one on the right channel with OpenAL, any ideas ?

vrm  :D

princec

Simply position it to the left or right as appropriate...

Cas :)

vrm

what kind of position is equal to full volume on left and no volume on right ?

princec

Hm, I see what you mean. I'm not sure that sound simulation actually allows that - you're always going to hear something in your other ear (OpenAL really treats your speakers like ears rather than speakers).

Why not just turn off distance attenuation on that source and move it a long way off to the left?

Cas :)

durandal

Quote from: "vrm"Hi there,

I try to play a mono wav file on the left channel and a second one on the right channel with OpenAL, any ideas ?

vrm  :D

The SoundAPI for JOSRTS has some concept if "left and right", and even though the balance is not 100% faded in one direction it has a very noticeable direction

       switch(pp.getDirection()) {
            case PlaybackProperties.CENTER:
                x = 0.0f;
                break;
            case PlaybackProperties.LEFT:
                x = -1.0f * balanceDistanceFactor;
                break;
            case PlaybackProperties.RIGHT:
                x = 1.0f * balanceDistanceFactor;
                break;
            default:
                x = 0.0f;
        }
        
        c.setProperty(AL.POSITION, x, 0.0f, 0.0f);


(balanceDistanceFactor is a constant set to 1.0f)

And setProperty comes down to this:

     
    public void setProperty(int type, float v1, float v2, float v3) {
        
        source.getContext().source3f(getName(), type, v1, v2, v3);

    }


I'm rather tired so I guess I'm not very structured but I hope it helps.

Kalle :)