[Note: to avoid stops and starts if you have a slow internet connection, pause the video for 30 seconds or so at the beginning to allow a minute or two of video to buffer before playing.]
About this site
Launched in July 2007 as documentation of a feasibility study for the integration of Second Life into the e-learning suite in the School of Computing & Information Systems (formerly the Faculty of Computing, Information Systems, and Mathematics) at Kingston University, UK, the site now serves as the Student Portal and blog of teaching a final-year module in virtual worlds development and strategy. See also the original About page.Static pages
- Contact form
- The Instructor View
- The Student View
- Tutorials
- Creating a book
- Creating seamless textures
- Creating Transparent Textures
- Customing a tourHUD
- Exporting and importing objects with Meerkat
- Importing music files into Second Life
- Making a tree
- Making machinima
- OpenSimulator
- Optimising for Search
- Other worlds
- SL Shared Media
- Teleporting between grids
- Terraforming using the Edit Land window
- The One-Prim Framed Picture
- Sculpties
- Working with textures
- Basics of scripting
- SL mashups
- Issues
- Applications
- Resources
- The Project
- About this site
Case studies
Content creation
In the News
MUVEs
Offline
OpenSim
Organisations
Other grids
Podcasts
Second Life at KU
SL general
SL in Education
- Berkman Center
- Educators Coop
- Learning from Social Worlds
- MUVE Forward
- My Second Life
- NMC Campus Observer
- OpenHabitat
- RezEd
- Second Life in Education
- SecondLife4Education
- Serious Games Institute
- Shimmer Island
- SL Best Practices International Conference 2007
- The Content Grid
- Virtual World Best Practices in Education
- Virtual World Watch
- Virtual Worlds Research Discussion Group
- Who Teaches What in SL
SL on Linux
Tutorials
Meta
Nice tutorial, and funny. Even my family liked it
However, I couldn’t get the Juke player code at said coordinates – your CDs on shelves refused cooperation.
So I created another piece of code with similar functionality, but with slight improvement. Namely, I noticed that there were audible breaks (or rather inaudible, since there was no music) at the points where audio chunks where supposed to join. I came up with an idea to split the track to 9 second long intervals, but each chunk started at multiplicity of 8. Hence there were overlapping 1 second chunks. So, in the script, I played 9-sec chunks with 8-sec timing.
Now, provided that bandwidth is good and SL doesn’t play tricks, the audio is a bit nicer to listen to.
Anton, I’ve now had a look at it — this is excellent! good work! Would you like to share your script with the rest of us?
Sure I can. I thought I had sent the item with full permissions, maybe I messed up something
Put audio chunks into object, then add the script:
*******************
// ==========================================================================
// AudioPlayer 1.0
// Author Anton Leman
// Script plays attached sounds with 8.0 sec timer
//============================================
// Declare globals
string version = “1.0″;
integer numSounds = 0; //numer of attached sounds
list gSounds = []; //list to store sound names
integer songNo = 0; //No of current sound in the list
integer play = 0; //player switch
default
{
state_entry()
{ //loading the list with sound names
integer i = 0;
numSounds = llGetInventoryNumber(INVENTORY_SOUND);
for (i=0; i1)
llPreloadSound(llList2String(gSounds, songNo));
llPreloadSound(llList2String(gSounds, songNo+1));
//play the 1st one
llPlaySound(llList2String(gSounds, songNo), 1.0);
//and start the timer with 8.0 interval
llSetTimerEvent(8.0);
//song number for next iteration/call in timer method
songNo++;
}
else
{
//if NO PLAY, then stop, reinitiate song number, disable timer
llStopSound();
songNo = 0;
llSetTimerEvent(0.0);
}
}
timer()
{
//check the number of chuncks against currently played chunk
if (numSounds>songNo)
{
//we still have more to play, go on
llPlaySound(llList2String(gSounds, songNo), 1.0);
//preload only if there will be more
if (numSounds>songNo+1) {
llPreloadSound(llList2String(gSounds, songNo+1));
}
//song number for next iteration/call in timer method
songNo++;
}
else {
//if the last has just finished, reinitiate and stop timer
play = 0;
songNo = 0;
llSetTimerEvent(0.0);
}
}
}
Anton thank you for the script! I tried though to use it in opensimulator in my world and found error. The compiller stops at “numSounds = llGetInventoryNumber(INVENTORY_SOUND);” could you please help me with this? I suppose something is wrong with me but what? Thanks in advance!
Do you have any sound files in your object when launching this script? If compiler stops at getting sounds out of inventory, it can mean there are no sounds.
Another note, the script is supposed to play several files, hence there is assumption of at least 2 files. If there is less, most of the code is unnecessary.
i put two files (wav files) in the object. Tried to compile but nothing. I suppose tha the error is due to incompatible web characters (from the site to the script). So can you send me an email of the script directly from you?
Yes, give me your email.
Cheers
gkefallonitis@yahoo.gr thanks!!!!!