Change font size
It is currently Tue May 21, 2013 2:54 am

Forum rules


Image



Post a new topicPost a reply Page 1 of 1   [ 7 posts ]
Author Message
 Post subject: Scripting for Sound issue
PostPosted: Sun Jun 10, 2012 10:44 pm 

Joined: Thu Jun 07, 2012 3:59 pm
Posts: 10
Hey guys,

I'm trying to track down a rather peculiar issue with scripting for sound. The script below is how I would normally do things in SL, but doesn't seem to work in OpenSim.

The issue is that, with the script below, the sounds play perfectly for myself (until I clear my cache), however nobody else is able to hear them. I've had it suggested that my own viewer is the cause of the problem, but I'm not quite convinced - it certainly doesn't explain why others are having difficulties hearing the sounds.

I'm just wondering whether somebody can pick out what the issue is?

Code:
default
{
    touch_start(integer total_number)
    {
        llPreloadSound("Daisy01");
        llPlaySound("Daisy01",1.0);
        llSleep(10);
        llPlaySound("Daisy02",1.0);
        llSleep(10);
        llPlaySound("Daisy03",1.0);
        llSleep(10);
        llPlaySound("Daisy04",1.0);
    }
}


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Mon Jun 11, 2012 12:52 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
dogwomble,

One thing I noticed off the bat, is that llPreloadSound is not yet implemented in OpenSim. Your script may compile under some veiwers, but not others.

I worked around this by creating a queue of my own, essentially a list that gets loaded with the names/uuids of the sounds, and then running through the list to play the sounds.

Try commenting out the llPreloadSound.

Are the sounds in the inventory of the prim containing the script? If they are in your inventory instead of the prim inventory, that could account for why users are not hearing the sounds. Also, make sure that the users have sound enabled and that volume controls in their viewer aren't muting the sounds.


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Mon Jun 11, 2012 3:45 pm 

Joined: Thu Jun 07, 2012 3:59 pm
Posts: 10
Thanks for the tip Shad - the llPreloadSound comment was one I wasn't aware of, but certainly one worth investigating.

In relation to the other points, I do keep a copy of the sounds in the prim inventory, and I know other sounds elsewhere called by script are audible, so this definitely does give me something to work with after work tonight :) I'll let you guys know how I go.


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Tue Jun 12, 2012 2:43 am 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 391
Location: England UK
Two things spring to mind with this right away.

1, do you have any parcels on your region? If so, it may eb a good idea to uncheck the option to 'restrict sound to this parcel' in the land options.

2, Your script (while would be ok in SL) is not good for opensim. Using llSleep in such a way is bad mojo (as WS would say ;)). What can happen is after 30 seconds of sleep the script thread can lock resulting in the script simply stopping working until it is recompiled.

It would be much better mojo to use a timer. Set the timer to 10 seconds, and use a vairable to increment each time to play the relevant sound. When the last sound is played, reset the variable to play the first sound again etc.

If you struggle with LSL, let me know and I will knock you something up that is much more opensim friendly :)

_________________
"...And then one day you'll find, ten years have got behind you, no one told you when to run, you missed the starting gun"
~Pink Floyd


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Tue Jun 12, 2012 5:34 am 

Joined: Thu Jun 07, 2012 3:59 pm
Posts: 10
Well, removing the llPreloadSound trick certainly helped.

I'll have a go with the timer. It's something I hadn't thought about, although it shouldn't be too hard.

The other thing I've found ... I've moved the grid to a local server I've got so I can play a bit more. Reducing the sound so I'm using more, but shorter, sounds has helped. Also increasing the maximum bandwidth I'm sending to the viewer has helped, although even setting it at 8 megabit doesn't make it perfect. I had sorta had an idea this could come up, hence why I wanted to use llPreloadSound initially. Any thoughts on this one?


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Wed Jun 13, 2012 1:51 pm 

Joined: Mon Apr 30, 2012 9:02 pm
Posts: 3
It's client side (mostly)...
Reference this: https://jira.secondlife.com/browse/SVC-7791


Top
 Profile  
 
 Post subject: Re: Scripting for Sound issue
PostPosted: Sun Jun 17, 2012 5:27 am 

Joined: Thu Jun 07, 2012 3:59 pm
Posts: 10
Aaah thanks very muich for the link Spectre - at the moment it describes my current issue perfectly. At the very least, I now have it working better by placing it into the timer, so at least that's something.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 7 posts ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net