Playing sound files consecutively

154 views
Skip to first unread message

Baron Hauptmann

unread,
Jun 15, 2010, 9:35:35 AM6/15/10
to Scripters

I seem to be stuck.  I am trying to play a series of sound files, one after the other.  Basically, it is music someone has played in RL, and wants it to be in an instrument.  So it is broken up into 9 second chunks.

I have tried a number of approaches to it, using queuing on and off, preloading (from the same script, same prim/different script, and linked prim), playing via timer, etc.  Things seem fine when I've already played it once, but when I first start it on a fresh login, I get huge breaks between them.

The person has a number of songs he wants to be able to play, so it is not conceivable to simply preload everything any time there is a new avatar in the area.  Rather, if I preload, it needs to be as the song is played.  I also don't want to have a long wait after the song is chosen while everything is preloaded, before the music starts.  I also do not want to use the parcel media stream.

I have searched forums and web for snippets or examples of a working song player.  Any example I have tried has suffered the same fate.  My home is a bit laggy (premium membership home), but I want this to be able to work even there.

Any suggestions?

 

Thanks,

Baron

Eloise Pasteur

unread,
Jun 15, 2010, 10:47:04 AM6/15/10
to Baron Hauptmann, Scripters
Stream off a server down either to audio or video channel?

I have seen a number Of in-world tools like this and all of them suffer this fate.

You could try other things like making the stage, seats etc. preload the audio each time someone new is detected but it's not ideal.

El. 

Sent from my iPad
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Frans

unread,
Jun 15, 2010, 11:28:04 AM6/15/10
to Scripters
Sadly there is no way to do it better then you are probably already doing.

The sim won't stream the music, the viewer will first download a piece before starting, so a wait between load and play is unavoidable. Though if you can predictively preload before a request that would help, like what eloise suggest when they sit down.

If you want streaming you will have to look at other solutions. What about a hidden Media on Prim, if you can't do parcel streaming. Is the objection against parcel streaming that he wants to be a roaming troubadour of sorts?

Maybe you can have your musician friend chat with SL musicians and have him see what they are doing, he might just like what they are doing. People generally prefer life performances better than recorded ones. Getting a stream and/or software is generally cheap/free.

Inworld sound snippets can be successfully used for longer events like drum circles, where it doesn't matter that it doesn't load instantly but is more about the communal beating and rhythm over a period of time.

I don't think that it will be a good idea for LL to add inworld streaming of uploaded sounds, it will just give them a bigger copyrights problem then they have now.

Regards,
Frans
--
Jeroen Frans
Virtual World Technology Specialist.
VesuviusGroup.com
SL: Frans Charming

Maxxi Short

unread,
Jun 15, 2010, 4:19:01 PM6/15/10
to Baron Hauptmann, secondlif...@lists.secondlife.com
I've found the easiest way to do this is to measure how long each snippet is, and put in a sleep for that time.
 
For instance, if sound1 is 5 seconds long, sound2 is 8 seconds long and sound3 is 4 seconds long:
 
llPlaySound(sound1, volume);
llSleep(5.0);
llPlaySound(sound2, volume);
llSleep(8.0);
llPlaySound(sound3, volume);
 
The final bit doesn't need a "sleep" of course. Primitive, but it works!
 
Maxxi.
 

Mycroft Mesmeriser

unread,
Jun 15, 2010, 10:10:55 PM6/15/10
to secondlif...@lists.secondlife.com
The current LSL methods for loading and playing 10 second sound files are appropriate for ambient background.  However no amount of original song dismemberment and coding concatenation has been able to (so far *) provide a quality music reproduction within SL.  
 
I would like for sound files to be several minutes in length.  I am pretty sure Amazon would be willing to provide the extra storage space, and SL’s executives could charge a new service fee for larger sound file uploads.  I hope that in the future there will be a way to upload and seamlessly play a single 5 minute sound file totally within SL (without separately hosted streaming).  Or play a sound file (maybe associated with a UUID) url stream, providing an uninterrupted sim to sim experience.  

Frans said:
Maybe you can have your musician friend chat with SL musicians and have him see what they are doing, he might just like what they are doing

Mycroft replies:
I first researched SL to explore music distribution, and I can emphatically tell you that SL has been absolutely unusable.   All a musician can do is play for a live audience –and that does not scale.  For a musician there is no chance of getting a hit success on the SL platform.  Imagine that from a musician’s perspective, it would be similar to limiting her/him to only playing one performance at a time live for small audiances – without any concurrent ability to simultaneously distribute the songs by MP3/etcetera –no exposure of performing on the Letterman show (10 million viewers), for example.  Or from a programmer’s perspective, it would be similar to limiting her/him to only coding one program for one client at a time –forget about selling that unique one-time single usage program on Xstreet.  

Frans said:
People generally prefer life performances better than recorded ones. 

Mycroft replies:
Live performances usually have poor sound quality (mis-calibrated audio mixer channel levels).  I have always preferred a well produced studio album.  Most always top selling hit songs were recorded and produced in a professional studio.  It may be fun to go to a live concert performance, however the artist always got famous in the first place via distribution of a professionally produced studio recording.  On the SL platform a professionally recorded song cannot be distributed as a whole quality audio unit.   

Frans said:
I don't think that it will be a good idea for LL to add inworld streaming of uploaded sounds, it will just give them a bigger copyrights problem then they have now.

Mycroft replies:
LL seems to function while balancing the occasional copyright problems associated with the existing content DMCA process.  I suppose that (inworld streaming of uploaded 5 minute audio files) is a calculated risk/reward business decision for LL to decide. 
 
* Note: I think that Philip was instrumental in the development of Real Audio (and he probably knows more about coding audio than I ever will understand), so I suspect the LL talent to improve audio playback features in SL is never far away.

-- 

Mycroft
INFORMATION LIMITED

Kubota Homewood

unread,
Jun 15, 2010, 10:53:47 PM6/15/10
to SL Scripters
I think you should consider using the music URL or media URL.  Why must SL re-invent everything?  You can stream anything you want, be it live or recorded.  There are services all over the internet to stream your content if you cannot.  I would much prefer SL to focus on serving us the assets that no one else can rather than use their bandwidth for things we can get elsewhere.  I don't know about you, but I have seem a dramatic reduction over the past 3 years in responsiveness of the assets (which in turn has made splicing sound files even more difficult).   I am not bashing Linden Labs.  It is a very difficult scaling problem they have.

Kubota



Reply all
Reply to author
Forward
0 new messages