Jump to content

Loop sound - volume control?


Leoplod
 Share

You are about to reply to a thread that has been inactive for 1818 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

The strange part is that llStopSound is indeed capable of halting looping audio created by llSound at any point (just tested in-world), but apparently it won't work for a non-looped one. I'm still puzzled why LL would choose to replace it instead of fixing what could legitimately be considered a bug back then. There could very well be more going on under the hood with these functions that we don't get to see which could have contributed to the switch.

I did some more poking around found the version 0.2.0 release notes on another wiki which were for one of the closed betas in 2002. There is a reference to llPlaySound there which implies it was already implemented before the public release of SL. That makes the choice to deprecate llSound in favor of llPlaySound even more intriguing. If it was done during closed beta, why keep llSound around at all? Very interesting!

 

 

Edited by Fenix Eldritch
typos
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Fenix Eldritch said:

The strange part is that llStopSound is indeed capable of halting looping audio created by llSound at any point (just tested in-world), but apparently it won't work for a non-looped one. I'm still puzzled why LL would choose to replace it instead of fixing what could legitimately be considered a bug back then. There could very well be more going on under the hood with these functions that we don't get to see which could have contributed to the switch.

I did some more poking around found the version 0.2.0 release notes on another wiki which were for one of the closed betas in 2002. There is a reference to llPlaySound there which implies it was already implemented before the public release of SL. That makes the choice to deprecate llSound in favor of llPlaySound even more intriguing. If it was done during closed beta, why keep llSound around at all? Very interesting!

 

 

Does not, even states you can not in the wiki. It will run the full file length. Also running the same loop sound concurrently was used by griefers.

Edited by steph Arnott
Link to comment
Share on other sites

Sorry, but that's not entirely true. In my testing, I've seen that there are some instances where llStopSound will be able to stop attached audio started by llSound. There are also other instances where it won't stop the sound, so I can understand the different results you might see if you tested it yourself. Below is a simple test harness which you can use to try the all different parameter combinations (the queue and loop parameters seem to change the nature of the sound with regards to whether it can be stopped by llStopSound). Uncomment one, save the script and then click the host prim before the audio completes. The comments indicate the results I saw when testing.

key audio = ""; //fill in your audio uuid (use as long a sound as possible)

default
{
  state_entry()
  {
    llStopSound();
    //llPlaySound(audio,1.0);		//can be stopped
    //llSound(audio,1.0,TRUE,TRUE);	//can be stopped
    //llSound(audio,1.0,FALSE,TRUE);	//can be stopped
    //llSound(audio,1.0,TRUE,FALSE);	//can't be stopped
    //llSound(audio,1.0,FALSE,FALSE);	//can't be stopped
  }

  touch_start(integer total_number)
  {
    llStopSound();
  }
}

 

I believe this is a case where the wiki's documentation is in need of an update and/or more clarification. Because the page for llStopSound also doesn't mention that it works for audio started by llPlaySound - in practice it does, which I included in my test script. Since it only explicitly mentions llLoopSound, it may be causing some confusion.

But this is getting a bit off topic :)

To circle back, if you want to adjust the volume of a currently playing attached sound, as others have said earlier llAdjustSoundVolume is one method - though it does incur a 0.1 second pause in script execution. Interestingly, llAdjustSoundVolume will work on the same instances of llSound for which llStopSound has an effect and it won't work for the instances that llStopSound doesn't effect. You can replace llStopSound in my example above with llAdjustSoundVolume and see similar results.

In either case, this is largely moot since llSound is deprecated and ostensibly we shouldn't be using it. The behavior we see today could very well change or break entirely at any point. Still, I find it pretty interesting.

Edited by Fenix Eldritch
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1818 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...