Difference between revisions of "LlLinkPlaySound/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{LSL_Function/ja
{{LSL_Function/ja
|inject-2={{LSL Function/link-face|link}}
|inject-2={{LSL Function/link-face|link}}
{{LSL_Function/inventory|sound|uuid=true|type=sound|volume=volume}}{{LSL Function/link-face|link}}
{{LSL_Function/inventory/ja|sound|uuid=true|type=sound|volume=volume}}{{LSL Function/link-face/ja|link}}
|func_id=|func_sleep=0.0|func_energy=10.0
|func_id=|func_sleep=0.0|func_energy=10.0
|func=llLinkPlaySound|sort=LinkPlaySound
|func=llLinkPlaySound|sort=LinkPlaySound
Line 7: Line 7:
|p2_type=string|p2_name=sound
|p2_type=string|p2_name=sound
|p3_type=float|p3_name=volume
|p3_type=float|p3_name=volume
|p4_type=integer|p4_name=flags|p4_desc=Bit flags used to control how the sound is played.
|p4_type=integer|p4_name=flags|p4_desc=サウンドの再生方法を制御するために使用されるビットフラグ。
|func_footnote
|func_footnote
|func_desc=Plays {{HoverText|attached|The sound moves with the prim}} {{LSLPT|sound}} once at {{LSLPT|volume}}
|func_desc={{HoverText|attached|サウンドはプリムと一緒に移動します}} {{LSLPT|}} {{LSLPT|音量}}で一度再生します。
|return_text
|return_text
|spec
|spec
|caveats=*A call to llPlaySound replaces any other sound (so that only one sound can be played at the same time from the same prim), except sounds started with the deprecated [[llSound]] which always plays sound files till the end.
|caveats=* llPlaySoundの呼び出しは他のすべてのサウンドを置き換えます(同じプリムから同時に1つのサウンドしか再生できないため)。ただし、非推奨の [[llSound]] で開始されたサウンドは常にサウンドファイルを最後まで再生します。
*Sound files must be 30 seconds or shorter.
* サウンドファイルは30秒以下である必要があります。
*Sounds are always sampled at 44.1KHz, 16-bit, mono (stereo files will have one channel dropped--merged (as in combined)--when uploading).
* サウンドは常に44.1KHz、16ビット、モノラルでサンプリングされます(ステレオファイルはアップロード時に1つのチャンネルが削除され、結合されます)。
*If the object playing the sound is a {{HoverLink|HUD|Heads Up Display}}, the sound is only heard by the user the HUD is attached to.
* サウンドを再生しているオブジェクトが {{HoverLink|HUD|ヘッドアップディスプレイ}} である場合、サウンドはHUDがアタッチされているユーザーにしか聞こえません。
**To play a sound inworld from a HUD use [[llTriggerSound]].
** HUDからワールド内でサウンドを再生するには、[[llTriggerSound]]を使用してください。
*It is impossible to play two (or more) sounds at the same time and have them start playing at exactly the same time ~ {{JIRA|VWR-15663}}
* 同時に2つ以上のサウンドを再生し、それらをまったく同じタイミングで開始することは不可能です。 〜 {{JIRA|VWR-15663}}
**If multiple sound emitters play the same exact sound within range of the viewer at the same time, they are usually not in sync due to latency between the server/client and script execution & communication delays. This can produce echos, odd resonance, and other strange effects that you (probably) do not want.
** 複数のサウンドエミッターが同じ音を同時にビューアの範囲内で再生する場合、通常はサーバー/クライアントとスクリプトの実行&通信遅延のために同期していません。これによりエコー、奇妙な共鳴、およびその他の奇妙な効果が生じる可能性があります(おそらく望ましくない)。
*When used in conjunction with [[llSetSoundQueueing]], sounds may incorrectly [https://community.secondlife.com/forums/topic/443645-llplaysound-plays-the-sound-twice-or-more/ play more than once.] This can be fixed by disabling the sound queue if only a single sound sample is to be played.
* [[llSetSoundQueueing]]と併用すると、[https://community.secondlife.com/forums/topic/443645-llplaysound-plays-the-sound-twice-or-more/ 正しくない場合があります。]これは、単一のサウンドサンプルのみを再生する場合にサウンドキューを無効にすることで修正できます。
*Use [[llLinkStopSound]] to stop a looped sound started in a link with [[SOUND_LOOP]]
* リンクされたオブジェクトで開始されたループサウンドを停止するには、[[llLinkStopSound]]を使用してください [[SOUND_LOOP]]と一緒に。
|constants={{LSL Constants/PlaySoundFlags}}
|constants={{LSL Constants/PlaySoundFlags/ja}}
|examples=<syntaxhighlight lang="lsl2">
|examples=<syntaxhighlight lang="lsl2">
default
default
Line 32: Line 32:
</syntaxhighlight>
</syntaxhighlight>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llTriggerSound]]|3=Plays a sound {{HoverText|unattached|The sound does not moves with the prim}}.}}
|also_functions={{LSL DefineRow||[[llTriggerSound/ja]]|3=サウンドを再生します {{HoverText|unattached|サウンドはプリムと一緒に移動しません}}.}}
{{LSL DefineRow||[[llTriggerSoundLimited]]}}
{{LSL DefineRow||[[llTriggerSoundLimited/ja]]}}
{{LSL DefineRow||[[llLoopSound]]|3=Plays a sound {{HoverText|attached|The sound moves with the prim}}.}}
{{LSL DefineRow||[[llLoopSound/ja]]|3=サウンドを再生します {{HoverText|attached|サウンドはプリムと一緒に移動します}}.}}
{{LSL DefineRow||[[llLoopSoundMaster]]}}
{{LSL DefineRow||[[llLoopSoundMaster/ja]]}}
{{LSL DefineRow||[[llLoopSoundSlave]]}}
{{LSL DefineRow||[[llLoopSoundSlave/ja]]}}
{{LSL DefineRow||[[llPlaySoundSlave]]}}
{{LSL DefineRow||[[llPlaySoundSlave/ja]]}}
{{LSL DefineRow||[[llSetSoundQueueing]]|3=Sets a prim property which allows sounds to be queued, instead of overwriting eachother.}}
{{LSL DefineRow||[[llSetSoundQueueing/ja]]|3=サウンドが互いに上書きされずにキューに追加されるようにするプリムのプロパティを設定します。}}
{{LSL DefineRow||[[llStopSound]]}}
{{LSL DefineRow||[[llStopSound/ja]]}}
{{LSL DefineRow||[[llLinkStopSound]]}}
{{LSL DefineRow||[[llLinkStopSound/ja]]}}
|also_events
|also_events
|also_tests
|also_tests

Revision as of 16:05, 22 November 2023

要約

関数: llLinkPlaySound( integer link, string sound, float volume, integer flags );

attached 音量で一度再生します。

• integer link リンク 番号 (0: リンクなし, 1: ルートプリム, >1: 子プリム) または LINK_* フラグ
• string sound プリムの インベントリ の中にあるsoundまたは UUID
• float volume 0.0 (消音) から 1.0 (大音量) (0.0 <= volume <= 1.0)
• integer flags サウンドの再生方法を制御するために使用されるビットフラグ。
Flag Description
LINK_ROOT 1 refers to the root prim in a multi-prim linked set[1]
LINK_SET -1 refers to all prims
LINK_ALL_OTHERS -2 refers to all other prims
Flag Description
LINK_ALL_CHILDREN -3 refers to all children, (everything but the root)
LINK_THIS -4 refers to the prim the script is in

定数 説明 LSL 関数
SOUND_PLAY 0x00 これがデフォルトの動作です。リンクされたプリミティブにアタッチされたサウンドを一度再生します。 llPlaySound
SOUND_LOOP 0x01 リンクされたプリミティブにアタッチされたサウンドをループ再生します。 llLoopSound
SOUND_TRIGGER 0x02 リンクされたプリミティブの場所でサウンドをトリガーします。サウンドはアタッチされず、プリムと一緒に移動しません。

このフラグが設定されている場合、他のすべてのフラグが上書きされます。

llTriggerSound
SOUND_SYNC 0x04 サウンドの再生を最寄りのサウンドマスターに同期させます。llLoopSoundMasterを参照してください。

llLoopSoundSlave, llPlaySoundSlave

警告

  • sound がプリムの中で見つからない場合、かつこれが UUID でない場合、またはこれがsoundでない場合、エラーが DEBUG_CHANNEL 上で叫ばれます。
  • soundUUID である場合、オブジェクト自体に新たな アセット権限 が発生するようなことはありません。
    • アセットをプリムのインベントリの中に置いた場合、これまで発生していた使用制限は新しいオブジェクトで新たに作成されません。
  • llPlaySoundの呼び出しは他のすべてのサウンドを置き換えます(同じプリムから同時に1つのサウンドしか再生できないため)。ただし、非推奨の llSound で開始されたサウンドは常にサウンドファイルを最後まで再生します。
  • サウンドファイルは30秒以下である必要があります。
  • サウンドは常に44.1KHz、16ビット、モノラルでサンプリングされます(ステレオファイルはアップロード時に1つのチャンネルが削除され、結合されます)。
  • サウンドを再生しているオブジェクトが HUD である場合、サウンドはHUDがアタッチされているユーザーにしか聞こえません。
    • HUDからワールド内でサウンドを再生するには、llTriggerSoundを使用してください。
  • 同時に2つ以上のサウンドを再生し、それらをまったく同じタイミングで開始することは不可能です。 〜 VWR-15663
    • 複数のサウンドエミッターが同じ音を同時にビューアの範囲内で再生する場合、通常はサーバー/クライアントとスクリプトの実行&通信遅延のために同期していません。これによりエコー、奇妙な共鳴、およびその他の奇妙な効果が生じる可能性があります(おそらく望ましくない)。
  • llSetSoundQueueingと併用すると、正しくない場合があります。これは、単一のサウンドサンプルのみを再生する場合にサウンドキューを無効にすることで修正できます。
  • リンクされたオブジェクトで開始されたループサウンドを停止するには、llLinkStopSoundを使用してください SOUND_LOOPと一緒に。
All Issues ~ Search JIRA for related Bugs

サンプル

default
 {
     state_entry()
     {
          llLinkPlaySound(LINK_ROOT, "some_sound", 1.0, SOUND_PLAY);
     }
 }

注意点

リンク番号

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

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

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

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

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

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

Link Numbers

Each prim that makes up an object has an address, a link number. To access a specific prim in the object, the prim's link number must be known. In addition to prims having link numbers, avatars seated upon the object do as well.

  • If an object consists of only one prim, and there are no avatars seated upon it, the (root) prim's link number is zero.
  • However, if the object is made up of multiple prims or there is an avatar seated upon the object, the root prim's link number is one.

When an avatar sits on an object, it is added to the end of the link set and will have the largest link number. In addition to this, while an avatar is seated upon an object, the object is unable to link or unlink prims without unseating all avatars first.

Counting Prims & Avatars

There are two functions of interest when trying to find the number of prims and avatars on an object.

integer GetPrimCount() { //always returns only the number of prims
    if(llGetAttached())//Is it attached?
        return llGetNumberOfPrims();//returns avatars and prims but attachments can't be sat on.
    return llGetObjectPrimCount(llGetKey());//returns only prims but won't work on attachments.
}
See llGetNumberOfPrims for more about counting prims and avatars.

Errata

If a script located in a child prim erroneously attempts to access link 0, it will get or set the property of the linkset's root prim. This bug (BUG-5049) is preserved for broken legacy scripts.

関連項目

関数

•  llGetLinkNumber Returns the link number of the prim the script is in.
•  llGetLinkNumberOfSides Returns the number of faces of the linked prim.
•  llGetLinkNumber スクリプトが入っているプリムのリンク番号を取得します。
•  llGetLinkNumberOfSides/ja Returns the number of faces of the linked prim.
•  llTriggerSound/ja サウンドを再生します unattached.
•  llTriggerSoundLimited/ja
•  llLoopSound/ja サウンドを再生します attached.
•  llLoopSoundMaster/ja
•  llLoopSoundSlave/ja
•  llPlaySoundSlave/ja
•  llSetSoundQueueing/ja サウンドが互いに上書きされずにキューに追加されるようにするプリムのプロパティを設定します。
•  llStopSound/ja
•  llLinkStopSound/ja

特記事項

Search JIRA for related Issues

脚注

  1. ^ LINK_ROOT does not work on single prim objects. Unless there is an avatar sitting on the object.

Signature

function void llLinkPlaySound( integer link, string sound, float volume, integer flags );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。