So I spent the evening
dreaming up a way for anyone to play a collection of MP3 files for free. You
don't even need to code up a script! You just make a URL and poke it onto the
prim. This technique uses the new Viewer 2.0 media on a prim feature, plus a
small script in Perl, hosted on this server. You can stream lots of MP3's, too,
as Google will host up to 100 megabytes for free.
There are lots of ways to pay someone money to stream audio into Second Life. Or
you can set up your own
free
streaming server. But setting up your own server is not that easy, it uses a
lot of that precious bandwidth you need to play with, and it requires open ports
in your cable modem/router/gateway which can be really tricky if you don't want
to get hacked. It took me hours to get the ports properly open in my FIOS router
for my stream for
Phaze Demesnes, and I know what I am doing (usually).
Here is what you need to do, step by step. It's pretty
easy, thanks to a small script and Google's free hosting.
All you need to do is upload your MP3 files to
http://sites.google.com and then copy and paste a URL
into a prim!
If it doesn't work, the name you entered is already taken.
Try it again, perhaps with a different name that is more
distinct. There was no error message when I used a common
name for my site.
2) Upload your MP3 files to a File cabinet:
a. Click the Create Page link at the top right hand of your
Google site:
b. Select the button at the top for file cabinet:
c. Give the File Cabinet a name and click Create Page:
d. Make sure you selected File Cabinet.
You'll end up with a new page where you can add MP3 files
with the Add file button. Here is a screen grab of my site,
in the File Folder named 'mp3' (doh)
e. Click Add file, and pick any MP3 file from your computer
or any web site:
f. After you upload your files, your screen will look
something like this (click for larger view)
Note: You must make your files public so that anyone can listen
to them. If you wear the prim as a HUID, only you can hear it. If you rez the prim in-world, then anyone with Shared Media can click it and play your files.
You are almost done! Click the play button to hear all my
files play one after another, just like you will in Second
Life:
Play
Ferds' sample music Play
one song
How does it work? My server will read your web site, and
write a web page with the proper code to play all your
files, one after the other. The script uses a combination of
Perl, the WWW::Mechanize module, and it plays data using a javascript-to-Flash
standalone Wordpress plugin by
Martin Laine. Open source software like this makes the world a great
place!
3) Go to Second Life and play your music
a. Log into Second Life, create a prim, and navigate to the
texture tab. At the bottom of that tab is the Add Media
button. Click that button and add a URL to it, formatted
like this one below. Be sure to add your Google site URL to
the part after the ID=
Your music files will play, one after the other, and then
loop endlessly.
Want it to play just once?
Add &Loop=no to the end of your URL when you enter it. Loop=yes will endless loop after all songs have
played. loop=no will stop at the end of the list. Default when Loop
parameter is blank = yes
Want to play just one song from your list?
Add '&File=Somename' and it will search for and only play files that
match that name. Partial
matches are supported, so for a file name MySong, &File=My or &File=Song will
play that one song, or any files that contain My or Song, anywhere in the name.
Internet Explorer users: Due to Adobe Flash cross domain
security issues, Internet Explorer does not work with my mp3.plx file in the demo. I have
set up a special mp4.plx program for this demo to get around this issue for this demo only. The mp3.plx program works fine in SL.