Add sound
Could someone point me to the absolute SIMPLIST way to add some sound to my OpenGL game? Right now, my game is just simple OpenGL. All I want is to be able to play some background music. VERY simple. Can someone point me to that?
OpenGL handles graphics only so you need to find sound library like OpenAL or something.
Hey bballmitch,
take a look at my Engine (3caste.chaubold.de),
there I used the BassAudioLibrary because it's so easy to use.
Look for the "cbass.h" in the /framework/ folder...
Or you download the library and add those functions to your source:
Where "file" is an wav or mp3 song, it'll be played as background music until you call:
take a look at my Engine (3caste.chaubold.de),
there I used the BassAudioLibrary because it's so easy to use.
Look for the "cbass.h" in the /framework/ folder...
Or you download the library and add those functions to your source:
HSTREAM soundStream;void initSound(){ BASS_Init(-1,44100,0,GetForegroundWindow());}void playSound(char *file,int vol=75){ log_txt("Bass Sound loading and playing: %s",file); soundStream=BASS_StreamCreateFile(FALSE,file,0,0,0); BASS_Start(); BASS_StreamPlay(soundStream,FALSE,BASS_SAMPLE_LOOP); BASS_ChannelSetAttributes(soundStream,-1,vol,-101);}
Where "file" is an wav or mp3 song, it'll be played as background music until you call:
BASS_Stop();
Quote:Original post by Caste
Hey bballmitch,
take a look at my Engine (3caste.chaubold.de),
there I used the BassAudioLibrary because it's so easy to use.
Look for the "cbass.h" in the /framework/ folder...
Or you download the library and add those functions to your source:HSTREAM soundStream;void initSound(){ BASS_Init(-1,44100,0,GetForegroundWindow());}void playSound(char *file,int vol=75){ log_txt("Bass Sound loading and playing: %s",file); soundStream=BASS_StreamCreateFile(FALSE,file,0,0,0); BASS_Start(); BASS_StreamPlay(soundStream,FALSE,BASS_SAMPLE_LOOP); BASS_ChannelSetAttributes(soundStream,-1,vol,-101);}
Where "file" is an wav or mp3 song, it'll be played as background music until you call:BASS_Stop();
Looks great, but that link doesn't work. It says that I don't have access to it. Maybe you could email me cbass.h ?
Sure I can e-Mail it to you, I only need your E-Mail address...
But what link didn't work? Did you mean the first two demos in my download section? Sorry for that, just fixed it..
But what link didn't work? Did you mean the first two demos in my download section? Sorry for that, just fixed it..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement