• Advertisement
Sign in to follow this  

OpenAL Where to start?

This topic is 3388 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

Hi ive created a basic game in opengl and now wish to add sound or music so to start with i downloaded the openAL SDK, Alut and openAl installer and installed all three. Im using visual studios but have no idea what to do next? *** i have vista 64bit and a soundblaster audigy **** I have put openal.dll >>>>> windows/system32. openal32.dll >>>>> windows/system32. OpenAl32.lib >>>>>> vc98/lib. EFX-Util.lib >>>>>> vc98/lib al.h alc.h efx.h efx-creative.h EFX-Util.h xram.h >>>>>> vc98/include. I think thats all right. What do i need to add the simplest piece of sound in my game to test it works please?

Share this post


Link to post
Share on other sites
Advertisement
Here is a simple test program that might work for you.

#include <alut.h>
//
ALuint alBuffer;
ALuint source;
//
alutInit(0, NULL);
alBuffer = alutCreateBufferFromFile("wave_file_name.wav");
alGenSources(1, &source);
alSourcei(source, AL_BUFFER, alBuffer);
alSourcef(source, AL_GAIN, 1.0f);
alSourcef(source, AL_PITCH,1.0f);
alSourcei(source, AL_LOOPING, AL_FALSE);
//
alSourcePlay(source);
alSourceStop(source);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement