介绍了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);
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库OpenAl笔记(6)在线全文阅读。
相关推荐: