Difference between revisions of "LlAdjustSoundVolume/ja"

From Second Life Wiki
Jump to navigation Jump to search
m (カテゴリ変更)
m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL_Function/volume/ja|volume}}{{LSL_Function/ja
{{LSL_Function/Headless
|default={{{default|}}}
|inject-2={{LSL_Function/volume/ja|volume}}{{LSL Function/link-face/ja|link}}
|summary=付随するサウンドの{{LSLP|volume}} を調整します。
 
|head={{LSL Function/Head
|func=llAdjustSoundVolume
|func=llAdjustSoundVolume
|sort=AdjustSoundVolume
|sort=AdjustSoundVolume
|func_id=207|func_sleep=0.1|func_energy=10.0
|func_id=207|func_sleep=0.1|func_energy=10.0
|p1_type=float|p1_name=volume
|p1_type=float|p1_name=volume}}
 
{{LSL Function/Head
|func=llLinkAdjustSoundVolume
|sort=LinkAdjustSoundVolume
|func_id=|func_sleep=0.1|func_energy=10.0
|p1_type=integer|p1_subtype=link|p1_name=link
|p2_type=float|p2_name=volume}}
 
|func_footnote
|func_footnote
|func_desc=添付された音の'''volume'''を調整します。
|func_desc
|return_text
|return_text
|spec
|spec
|caveats
|caveats=[[llTriggerSound/ja]]と[[llCollisionSound/ja]]では動作しません
|constants
|constants=
|examples=
|examples=
<lsl>
<source lang="lsl2">
default
default
{
{
Line 26: Line 39:
     }
     }
}
}
</lsl>
</source>
<source lang="lsl2">
default
{
    collision_start(integer p)
    {
        llPlaySound("5df2e97f-d3ab-9a80-7063-69007470a182", 1.0);
        llAdjustSoundVolume(1.0f);
        llSetTimerEvent(0.2f); //0.2秒後に再生中の音量を小さくします
    }
    timer(){
        llAdjustSoundVolume(0.1f);
        llSetTimerEvent(0.0f);
    }
}
</source>
 
|helpers
|helpers
|also_functions
|also_functions=
{{LSL DefineRow||[[llLinkPlaySound/ja]]|}}
{{LSL DefineRow||[[llLinkSetSoundQueueing/ja]]|}}
{{LSL DefineRow||[[llLinkSetSoundRadius/ja]]|}}
{{LSL DefineRow||[[llLinkStopSound/ja]]|}}
{{LSL DefineRow||[[llLoopSound/ja]]|}}
{{LSL DefineRow||[[llLoopSoundMaster/ja]]|}}
{{LSL DefineRow||[[llLoopSoundSlave/ja]]|}}
{{LSL DefineRow||[[llPlaySound/ja]]|}}
{{LSL DefineRow||[[llPlaySoundSlave/ja]]|}}
{{LSL DefineRow||[[llPreloadSound/ja]]|}}
{{LSL DefineRow||[[llSetSoundQueueing/ja]]|}}
{{LSL DefineRow||[[llSetSoundRadius/ja]]|}}
{{LSL DefineRow||[[llSound/ja]]|}}
{{LSL DefineRow||[[llSoundPreload/ja]]|}}
{{LSL DefineRow||[[llStopSound/ja]]|}}
|also_events
|also_events
|also_tests
|also_tests
Line 36: Line 80:
|negative_index
|negative_index
|cat1=Sound/ja
|cat1=Sound/ja
|cat2
|cat2=Script/ja
|cat3
|cat3
|cat4
|cat4
|history={{LSL Added|0.2.0|remote=http://secondlife.wikia.com/wiki/Version_0.2.0}}
}}
}}

Latest revision as of 21:38, 7 October 2023

Summary

Summary: llAdjustSoundVolume, llLinkAdjustSoundVolume

付随するサウンドのvolume を調整します。

llAdjustSoundVolume

Function: llAdjustSoundVolume( float volume );
• float volume 0.0 (消音) から 1.0 (大音量) (0.0 <= volume <= 1.0)
Caveats
  • This function causes the script to sleep for 0.1 seconds.
All Issues ~ Search JIRA for related Bugs

llLinkAdjustSoundVolume

Function: llLinkAdjustSoundVolume( integer link, float volume );
• integer link リンク 番号 (0: リンクなし, 1: ルートプリム, >1: 子プリム) または LINK_* フラグ
• float volume 0.0 (消音) から 1.0 (大音量) (0.0 <= volume <= 1.0)
Caveats
  • This function causes the script to sleep for 0.1 seconds.
All Issues ~ Search JIRA for related Bugs
フラグ 説明
LINK_ROOT 1 リンクセットの中のルートプリムに送ります
LINK_SET -1 全プリムに送ります
LINK_ALL_OTHERS -2 自分以外の全プリムに送ります
フラグ 説明
LINK_ALL_CHILDREN -3 (ルートプリム以外の全ての)子プリムに送ります
LINK_THIS -4 スクリプトの入った自プリムに送ります

Examples

default
{
    state_entry()
    {
        llListen(42, "", llGetOwner(), "");
    }

    listen(integer chan, string name, key id, string msg)
    {
        float value = (float)msg;
        llAdjustSoundVolume(value);
        llOwnerSay("Volume set to: " + (string)value + " of 1.0");
    }
}
default
{
    collision_start(integer p)
    {
        llPlaySound("5df2e97f-d3ab-9a80-7063-69007470a182", 1.0);
        llAdjustSoundVolume(1.0f);
        llSetTimerEvent(0.2f); //0.2秒後に再生中の音量を小さくします
    }
    timer(){
        llAdjustSoundVolume(0.1f);
        llSetTimerEvent(0.0f);
    }
}

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.
•  llLinkPlaySound/ja
•  llLinkSetSoundQueueing/ja
•  llLinkSetSoundRadius/ja
•  llLinkStopSound/ja
•  llLoopSound/ja
•  llLoopSoundMaster/ja
•  llLoopSoundSlave/ja
•  llPlaySound/ja
•  llPlaySoundSlave/ja
•  llPreloadSound/ja
•  llSetSoundQueueing/ja
•  llSetSoundRadius/ja
•  llSound/ja
•  llSoundPreload/ja
•  llStopSound/ja

Deep Notes

History

Search JIRA for related Issues

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 llAdjustSoundVolume( float volume );
function void llLinkAdjustSoundVolume( integer link, float volume );