Wednesday, 23 September 2009

trasform sound so that you can change the levels of sound into the speakers

mySound .setTransform( soundTransformObject )

leftOutput = left_input * ll + right_input * lr
rightOutput = right_input * rr + left_input * rl


ll = 100
lr = 0
rr = 100
rl = 0

// mono settings

ll = 100
lr = 100
rr = 0
rl = 0




//The following code creates a new soundTransformObject object and sets its properties so that sound from both channels will play only in the left channel. mySoundTransformObject = new Object;
mySoundTransformObject.ll = 100;
mySoundTransformObject.lr = 100;
mySoundTransformObject.rr = 0;
mySoundTransformObject.rl = 0;
//To apply the soundTransformObject object to a Sound object, you then need to pass the object to the Sound object using the setTransform method as follows:mySound.setTransform(mySoundTransformObject); The following example plays a stereo sound as mono; the soundTransformObjectMono has the following parameters. mySoundTransformObjectMono = new Object;
mySoundTransformObjectMono.ll = 50;
mySoundTransformObjectMono.lr = 50;
mySoundTransformObjectMono.rr = 50;
mySoundTransformObjectMono.rl = 50;
mySound.setTransform( soundTransformObjectMono );
//This example plays the left channel at half capacity and adds the rest of the left channel to the right channel; the soundTransformObjectHalf has the following parameters. mySoundTransformObjectHalf = new Object;
mySoundTransformObjectHalf.ll = 50;
mySoundTransformObjectHalf.lr = 0;
mySoundTransformObjectHalf.rr = 100;
mySoundTransformObjectHalf.rl = 50;
setTransform( soundTransformObjectHalf );
See alsoConstructor for the Object (object)

No comments: