3DSTATE for Visual basic.Net开发(十)

来源:互联网 发布:赋码软件 编辑:程序博客网 时间:2024/05/16 08:22

 3DSTATEfor Visual basic.Net开发

三峡大学土木水电学院3S实验室 肖泽云

注:转载请说明来源处!

八、Sound声音

为了保证能播放声音,首先必须把C:/VBNet 3D Developer Studio 6.0 (Student Package)/Engine/DLLs中的fmod.dll文件放在可执行程序的同一个目录下。Sound API可以播放MP3和WAV两种格式。
1、导入声音文件
用函数STATE_sound_load
2、播放、停止音乐
播放音乐用函数STATE_sound_play,停止播放用函数STATE_sound_stop,设置音量用函数STATE_sound_set_volume,设置声音能达到的最远距离用函数STATE_sound_set_distance_reach。如下:
Dim soundpath AsString = "F:/music/lavita.mp3"
Dim msound As UIntPtr = STATE_sound_load(soundpath, 0, 100)
        STATE_sound_play(msound, 0)

原创粉丝点击