LlLoopSoundMaster
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: llLoopSoundMaster( string sound, float volume ); |
| 参数:
• string sound – a sound in the inventory of the prim this script is in or a UUID of a sound • float volume – between 0.0 (silent) and 1.0 (loud) (0.0 <= volume <= 1.0) |
| 返回值:
播放附加声音循环在音量,声明它是一个同步主机。 |
| 注意事项 |
|---|
注意事项
结果对象不会产生任何新的使用限制,如果资产被放置在 prims 库存中,则可能会产生这种限制。 |
| 示例 |
|---|
// for an uploaded .wav file called "MasterLoop" in inventory
llLoopSoundMaster("MasterLoop", 1.0);
下面的脚本可以添加到一个对象中,来切换一个 soundmaster 的开关。注意,脚本需要一个名为 masterloop 的声音,或者需要更改函数中的参数才能工作。 //This integer (actually a boolean) will be used to manage the toggle effect.
integer soundState = FALSE;
//Change MasterLoop to the sound clip you want to use.
string soundClip = "MasterLoop";
default {
state_entry()
{
//Displays red "OFF" as floating text above the prim
llSetText("OFF", <1,0,0>, 1.0);
}
touch_start(integer num_detected)
{
//When touched, soundState inverts its current boolean value. 1 becomes 0, 0 becomes 1.
soundState = !soundState;
if(soundState)
{
//Run this code when entering soundState 'on'
//Displays green "ON" as floating text above the prim
llSetText("ON", <0,1,0>, 1.0);
llLoopSoundMaster(soundClip, 1.0);
}else
{ //Run this code when entering soundState 'off'
//When touched, stop sound & display red "OFF" as floating text.
llSetText("OFF", <1,0,0>, 1.0);
llStopSound();
}
}
}
|
| 相关函数 |
|---|
| llLoopSound--无限期地播放附加的声音
llPlaySoundSlave--播放过一次声音 |
| 相关事件 |
|---|