LlSetSoundQueueing/ja

From Second Life Wiki
Jump to navigation Jump to search

Summary

Summary: llSetSoundQueueing, llLinkSetSoundQueueing

付随したサウンドの再生を、現在のサウンドが終わるまで待つかどうかを設定します。 queueTRUE の場合、待機し、 FALSE で待機しなくなります。デフォルトでは、待機しません。

llSetSoundQueueing

Function: llSetSoundQueueing( integer queue );
• integer queue 真偽値, サウンドの待機: TRUE ならば有効 、 FALSE ならば行わない (デフォルト)
All Issues ~ Search JIRA for related Bugs

llLinkSetSoundQueueing

Function: llLinkSetSoundQueueing( integer link, integer queue );
• integer link リンク 番号 (0: リンクなし, 1: ルートプリム, >1: 子プリム) または LINK_* フラグ
• integer queue 真偽値, サウンドの待機: TRUE ならば有効 、 FALSE ならば行わない (デフォルト)
All Issues ~ Search JIRA for related Bugs
フラグ 説明
LINK_ROOT 1 リンクセットの中のルートプリムに送ります
LINK_SET -1 全プリムに送ります
LINK_ALL_OTHERS -2 自分以外の全プリムに送ります
フラグ 説明
LINK_ALL_CHILDREN -3 (ルートプリム以外の全ての)子プリムに送ります
LINK_THIS -4 スクリプトの入った自プリムに送ります

Caveats

  • 同時に待機できる音声は 2 個までのようです。 SVC-4260
  • Further to the above, the queue order is reversed when using llPlaySoundSlave/ja - using the below example, the default behaviour would be to play SoundName1 and SoundName2, however when using the aforementioned function the order would be to play SoundName2 and SoundName3.
  • 音声の待機状態はプリムの属性であり、特定のスクリプトに依存しません。待機状態はプリム内のいかなるスクリプトによっても有効化・無効化可能であり、その状態はスクリプトがリセット・再rez・削除されても保持されます。
  • スレーブ/マスターのサウンドのスムーズな移り変わりにこれを使用すると、同期がとれなくなる可能性が高いです。
  • Although sounds are queued, the volume of all sounds in the queue is set by the last item in the queue. If your application requires the use of differing volume values, you may wish to implement llAdjustSoundVolume/ja alongside the sound queue
  • There is a very small (but audible) gap of silence between sounds due to network latency and processing time.
  • The queued sound must be fully loaded in the viewer, or else it will not play. llPreloadSound/ja is not always reliable in doing its job.
  • Queueing a sound that is identical to the one currently playing will fail. Use llLoopSound/ja instead.
  • While this function does not have a delay, enabling or disabling the sound queue is not instant. It seems to take approx ~0.1 seconds to set the queueing flag.
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    state_entry()
    {
        llPreloadSound("SoundName1");//視界に入るビューワの全てにサウンドをロードさせ、サウンド間の待ちをなくします。
        llPreloadSound("SoundName2");//サウンドパラメータは全てのプリムのインベントリにある名前か、サウンドの UUID になります。
        llPreloadSound("SoundName3"); //This sound will be skipped, as the queue is only 1 level deep.
    }
    touch_start(integer detected)
    {
        llSetSoundQueueing(TRUE);//TRUE を設定して、 SoundName2 を SoundName1 が終わってから再生するように待機させます。
        //FALSE に設定すると、 2 番目のものだけが再生されます。プリムは 1 つの再生装置しか持っておらず、最後に呼ばれたのが 2 番目のサウンドだからです。
        //スクリプトのどこででも設定できます (イベントにあると、イベントが発生したときにそれが有効になることになります) 。
        llPlaySound("SoundName1", 1.0);
        llPlaySound("SoundName2", 1.0);
        llPlaySound("SoundName3", 1.0); //This sound isn't played as the queue is already full, so this is discarded.
    }
}

Notes

リンク番号

オブジェクトを構成するそれぞれのプリムにはアドレスがあります。それがリンク番号です。オブジェクトの特定のプリムにアクセスするには、そのプリムのリンク番号を知らなければなりません。リンク番号はプリムに振られますが、オブジェクトに座っているアバターにも振られます。

  • オブジェクトが単一のプリムで構成されていて、アバターが座っていないとき、(ルート)プリムのリンク番号は 0 です。
  • しかし、オブジェクトが複数のプリムで構成されていたり、オブジェクトに座っているアバターがいたりすると、ルートプリムのリンク番号は 1 となります。

アバターがオブジェクトに座ると、リンクセットの末尾に追加され、いちばん大きなリンク番号が振られることになります。さらに、アバターがオブジェクトに座っている場合、アバターを立たせないと、プリムのリンク・リンク解除ができません。

プリムやアバターの数え方

オブジェクトのプリムや、プリムに座っているアバターの数を調べるのに、2つの関数があります。

  • llGetNumberOfPrims() - プリムと座っているアバターの数を返します。
  • llGetObjectPrimCount(llGetKey()) - オブジェクトのプリムの数だけを返しますが、アタッチメントとなっている場合は 0 を返します。
integer GetPrimCount() { //常にプリムの数だけを返します。
    if(llGetAttached())//装着されているか?
        return llGetNumberOfPrims();//アバターとプリムの数を返しますが、アタッチメントの上には座れないのでこれでいいです。
    return llGetObjectPrimCount(llGetKey());//プリムの数だけを返しますが、アタッチメントの場合ここは通りません。
}

See Also

Functions

•  llGetLinkNumber スクリプトが入っているプリムのリンク番号を取得します。
•  llGetLinkNumberOfSides/ja Returns the number of faces of the linked prim.
•  llLoopSound/ja
•  llLoopSoundSlave/ja Plays a looped sound attached, synced with the master.
•  llPlaySoundSlave/ja Plays a sound once attached, synced with the master.
•  llAdjustSoundVolume/ja Adjusts the volume of playing sound(s).

Deep Notes

History

All Issues

~ Search JIRA for related Issues
   Since llSetSoundQueueing only allows two sounds to be played in queue can it be changed to allow more?

Footnotes

  1. ^ Early release notes were not very accurate or thorough, they sometimes included information about features added in previous releases or failed to include information about features added in that release.

Signature

function void llSetSoundQueueing( integer queue );
function void llLinkSetSoundQueueing( integer link, integer queue );