介绍了openal的基本用法
} ALenumformat; void* data; ALsizeisize; ALsizeifrequency; ALbooleanloop; alutLoadWAVFile("BEEP3.WAV",&format,&data,&size,&frequency,&loop); alBufferData(bufferIndex,format,data,size,frequency); if (alGetError() != AL_NO_ERROR) { } alutUnloadWAV(format,data,size,frequency); // 源 alGenSources(1,&sourceIndex); // 第二个源 alGenSources(1,&sourceTwoIndex); alSourcei(sourceIndex,AL_BUFFER,bufferIndex); if (alGetError() != AL_NO_ERROR) { } alutLoadWAVFile("EXP0.WAV",&format,&data,&size,&frequency,&loop); alBufferData(bufferTwoIndex,format,data,size,frequency); if (alGetError() != AL_NO_ERROR) { } alutUnloadWAV(format,data,size,frequency); alSourcei(sourceTwoIndex,AL_BUFFER,bufferTwoIndex); // 设置源的信息 ALCfloatsourcePos[] = {2,0,2}; ALCfloatsourceVel[] = {1,1,1}; alSourcefv(sourceIndex,AL_POSITION,sourcePos); alSourcefv(sourceIndex,AL_VELOCITY,sourceVel); alSourcei(sourceIndex,AL_LOOPING,AL_TRUE); alSourcef(sourceIndex,AL_GAIN,1); alSourcef(sourceIndex,AL_PITCH,1); exit(0); exit(0); exit(0);