[Openal] OpenAL .. Directional Effects .. Need Help

Cherukuri Jyothi Swaroop jyothiswaroop at gmail.com
Thu Jan 20 00:59:16 PST 2011


Hi



I ported OpenAL to our platform and able to play the wav files.

I wrote a sample openal application and try to produce some sound effects.

Play back of audio is working but sound effects are not working.



I am using jungle.wav which is mono channel sound wave file as input



# The Code snippet used is mentioned below.



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

#define NUM  2



    alutInit(0,0) ;

    alGetError();



    SourcesPos[0] =  SourcesPos[1] = SourcesPos[2] =   0.0f;
    ListenerPos[0] = ListenerPos[1] = ListenerPos[2] = 0.0f;



    ListenerOri[0] =  0.0f;
    ListenerOri[1] =  0.0f;
    ListenerOri[2] =  -1.0f;
    ListenerOri[3] =  0.0f;
    ListenerOri[4] =  1.0f;
    ListenerOri[5] =  0.0f;



    alListenerfv(AL_POSITION,    ListenerPos);

    alListenerfv(AL_ORIENTATION, ListenerOri);



    alGenBuffers(NUM, Buffers);



    Buffer[0]= alutCreateBufferFromFile("/Res/jungle.wav");
    err = alutGetError();



    alGenSources(NUm, Sources);



    alSourcei (Sources[0], AL_BUFFER,   Buffers[0]  );
    alSourcef (Sources[0], AL_REFERENCE_DISTANCE, 25*2);
    alSourcefv(Sources[0], AL_POSITION, SourcesPos);



    SourcesPos[0] = 200;
    SourcesPos[1] = 200;
    SourcesPos[2] = 25;
    alSourcefv(Sources[source], AL_POSITION, SourcesPos);



    alSourcePlay(Sources[source]);



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



I am expecting the sound to be played in the right headphone/speaker.

But the sound is played in both the headphones.



I used wave device and generated the output.wav file.

In that file also the sound is played in both the headphones.





I used the following settings for configuring OpenAL alsoft.conf.

Someone please help me the error in the above code.

Does OpenAL able to generate the right sound or left sound effect depending
on the co ordinates



format = AL_FORMAT_STEREO16

cf_level = 0

frequency = 44100

refresh = 4096

sources = 256

stereodup =   false

drivers = osp  // Our platform


excludefx =

layout_STEREO =  fl=-90, fr=90

layout_QUAD =  # Sets the speaker layout when using quadriphonic output.
               # Available speakers are back-left(bl), front-left(fl),
               # front-right(fr), and back-right(br).
               # The default is:
                 bl=-135, fl=-45, fr=45, br=135

layout_51CHN = bl=-110, fl=-30, fc=0, fr=30, br=110

layout_61CHN = sl=-90, fl=-30, fc=0, fr=30, sr=90, bc=180

layout_71CHN =  bl=-150, sl=-90, fl=-30, fc=0, fr=30, sr=90 br=150

device = default

periods = 0

capture = default

mmap = true


[wave]  # Wave File Writer stuff
file =  # Sets the filename of the wave file to write to. An empty name
        # Default is empty

volume = 100




*Cheers
Jyothi Swaroop

"Never fear shadows. They simply mean there's a light shining somewhere
nearby."
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20110120/c330785e/attachment.html


More information about the Openal mailing list