krpano教程 - 场景中加入声音

krpano 教程 - 场景中加入声音


1、引入声音控件

在tour.xml加入导入插件代码

	<plugin name="soundinterface"
	        url="%SWFPATH%/plugins/soundinterface.swf"
	        alturl="%SWFPATH%/plugins/soundinterface.js"
	        rootpath=""
	        preload="true"
	        keep="true"
	        />
或

在在tour.xml调用sound.xml文件

<include url="%SWFPATH%/sound/sound.xml" />


2、加入调用声音代码

一般声音
playsound(bggsnd, '%SWFPATH%/sound/music1.mp3', 10);

方向声音
playsound3D(s1,music1.mp3, 0,0);

暂停声音:pausesound(bggsnd);

恢复声音:resumesound(bggsnd);

暂停/恢复声音:pausesoundtoggle(bggsnd);

停止声音:stopsound(s1);

停止所有声音:stopallsounds();
VR全景制作   VR安全教育

猜你喜欢

转载自blog.csdn.net/vrlook/article/details/80343789