OpenAl笔记(6)

2021-04-05 08:45

介绍了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);


OpenAl笔记(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:从实践中启迪智慧

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: