llAdjustSoundVolume does not function for llPlaySound and values of 0 on first call
tracked
Alkaia Exonar
llAdjustSoundVolume (and llLinkAdjustSoundVolume) silently fails to adjust volume to 0 if the volume of a given llPlaySound has not already been adjusted to another number first. This seems to only affect llPlaySound, and llLoopSound seems to work if set to 0 immediately.
As a workaround, using llAdjustSoundVolume on the intended volume directly after llPlaySound is called functions to later allow the volume to be set to 0.
Log In
Maestro Linden
updated the status to
tracked
Maestro Linden
Alkaia Exonar thanks for the report. I can also reproduce the bug with this script:
default
{
touch_start(integer total_number)
{
llSay(0, "My key is " + (string)llGetKey());
key sound = "12cc9a60-3610-da3f-f557-22d473c3a635";
float initVolume = 0.9;
llSay(0, "Calling llPlaySound(\"" + (string)sound + "\", " + (string)initVolume);
llPlaySound(sound, initVolume);
llSleep(5);
float newVolume = 0.0;
llSay(0, "Calling llAdjustSoundVolume(" + (string)newVolume + ")");
llAdjustSoundVolume(newVolume);
}
}
With the original version of the script, there is no change in playback loudness when the script calls
llAdjustSoundVolume(0)
. Using Hippolyzer to monitor the message log, I see that the simulator does not
send the AttachedSoundGainChange
message to the viewer.On the other hand, if I modify the script to call
llAdjustSoundVolume
with a nonzero value like 0.01, the change is immediately audible. In this case with expected behavior, the viewer gets this message to trigger the loudness change:IN AttachedSoundGainChange
# ID: 4263
[DataBlock]
ObjectID = 295fb63e-099e-a55a-c986-6d9f9ac8a45a
Gain = 0.009999999776482582
This issue had previously been reported in jira, at https://github.com/secondlife/jira-archive-internal/issues/66296 , but that issue was lacking any details. As such, I'm importing this to a new issue.
Alkaia Exonar
Canny ate my repo steps and also won't let me edit the main feedback post for some reason so:
Reproduction:
Using the above script, during each individual play of the song clip you can:
- Click once. Intended effect: 0 volume. Actual effect: No change
- Click twice. Intended effect: 0 volume, then normal volume. Actual effect: No change
- Click thrice. Intended effect. 0 volume, then normal volume, then 0 volume. Actual effect: No change, no change, then 0 volume.