LlLoopSoundMaster/ja

From Second Life Wiki

Jump to: navigation, search

関数: llLoopSoundMaster( string sound, float volume );

volumeの音量にて連続で、添付されたsoundを再生し、同期マスターとして定義します。

• string sound sound名、あるいはUUID
• float volume 0.0(消音)と1.0(大音量)の間(0.0 <= volume <= 1.0)

警告

  • soundがプリム内から無くなっている場合、UUIDがない、あるいはそのsoundではない場合、エラーがDEBUG_CHANNELで報告されます。

 
// for an uploaded .wav file called "MasterLoop" in inventory
llLoopSoundMaster("MasterLoop", 1.0);
 

下のスクリプトはオブジェクトに追加されると音声マスターのオンとオフを切り替えることができます。スクリプトはマスタの連続再生で呼ばれるインベントリ内の音声、あるいはこれを動かすための関数の引数の変更が必要です。このスクリプトはToggle_Statesスクリプトの簡単な変更物で。動かすにはllLoopSoundMasterとllStopSoundを加えるだけです。

 
default {
    state_entry() {
        // run this code when entering the default state
        // displays red "OFF" as floating text above the prim
        llSetText("OFF", <1,0,0>, 1.0);
    }
    touch_start(integer num_detected) {
        // when touched, switch to state named 'on'
        state on;
    }
}
 
state on {
    state_entry() {
        // run this code when entering state 'on'
        // displays green "ON" as floating text above the prim
        llSetText("ON", <0,1,0>, 1.0);
        llLoopSoundMaster("MasterLoop", 1.0);
    }
    touch_start(integer num_detected) {
        // when touched, stop sound & switch back to the default state
        llStopSound();
        state default;
    }
}
 
Personal tools