Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Streaming Audio

Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
03-09-2005 09:00
Hey i was wondering if anyone had examples of a streaming audio script. Im very curious plus i would like this for a current project im working on. If anyone knows how this works it would be great for some input. :)

I was also wondering if there was a third(or first) party proggy where I could at least compile scripts outside of SL. This way I could test my script ideas at work. :-P And not have to sneak into SL (dangerous :-P) once im in i could get stuck in there for a while and never get work done hehehe... Thanks in advance i know theres a lot of wizzes here :-) im sure someone can help . WOOOT SL!
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-09-2005 09:07
What do you want to do with it?

There are several radio tuner type devices and scripts around (I make one, but there are several others), that will take controls to set the parcel music URL.

The core of the script for mine is list handling and the llSetParcelMusicURL command.
Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
Well...
03-09-2005 10:39
Id i know its kinda selfish but i want to keep it a secret. It will be a surprize and obviously will be given to those that help :-P But basically i want to script an object to have a few stations and stream them. I tried searching google for streaming SL audio sites. couldnt find anything. So yeah im wondering if you could show me how i could do this. I imagine it would be fairly short and sweet, besides the "change channel" commands. So yeah basically like a radio. But i want to make my own. I have a sweet idea. Will show you guys once I figure out how to do this. :-P
Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
Lol
03-09-2005 10:44
I know im a goof. I looked at the link to the WIKI after i wrote my post. This is great thanks for the command. One thing i have an issue with? Where would i find streamin stations? Could someone refer me to a list? Thanks guys . This forum rocks!!!
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-09-2005 12:57
try http://www.virtualtuner.com/ and good luck
Kats Kothari
Disturbingly Cute
Join date: 14 Aug 2003
Posts: 556
03-09-2005 20:53
From: Smigmee Pinkerton
I know im a goof. I looked at the link to the WIKI after i wrote my post. This is great thanks for the command. One thing i have an issue with? Where would i find streamin stations? Could someone refer me to a list? Thanks guys . This forum rocks!!!


I have a notecard inworld with a list of streaming audio URLs, the kind of music they stream and the name of the station. I'll drop one on you when I'm inworld. :)
_____________________
Maker of many kawaii items: Dolls, huggable plushies, and purses with cute critters.
Visit Kats' Kreatures for a better look and feel free to explore! =^_^=
Kats' Kreatures Gualala (140,9)


"The cat is cryptic, and close to strange things which men cannot see..."
- H.P. Lovecraft
Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
Ok So ive hit quite a barrier
03-09-2005 20:59
Ok. Smigmee here again..

So i didnt realize i cant stream audio off a parcel. Ok so heres what im doing and maybe someone can help. I want to make a walkman/diskman.

I.e. Someone wears headphones and can listen to music. I want this for myself mainly because im in the sandbox and i want to jam... (know what im sayin) Anyways I found this on the Wiki :

"This means, for those who do have a webserver where they can just upload simple files, but not run streaming servers, you can now have multiple .mp3/.ogg files there and a script in world that just switches the URL to point to each file in succession (it'll have to know how long each song is though)."

Am i understanding that all i need to do is upload various mp3s to my ftp server and i can stream those? Im very set on doing this and i think it would be a popular item. But im sure its not the llSetParcelMusicURL so im wondering how i would do this. ? Anyone ?

Thanks
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-10-2005 02:40
Basically you can't!

Streaming music needs to be associated with a land parcel.

What you can do is build up a series of .wav files and run it through the various sound statements, although I must admit I've never done it.

It is a real faff though!
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
03-10-2005 04:11
If you want to stream music just for you, just run Winamp or iTunes in the background. Easy. :)
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
Hmm
03-10-2005 06:35
Yes obviouisly i can stream to myself from winamp. But like i posted above. They say it IS possible to stream without a land parcel. Maybe someone has done this, or knows about how it would be done. Otherwise yes i know i cant stream to ppl without land. But i know i can still use this function some how/
McWheelie Baldwin
Registered User
Join date: 9 Apr 2004
Posts: 154
03-10-2005 06:52
They don't say it's possible to stream without land, they say it's possible to listen to music without the use of a streaming server. Big difference. Sorry to say, you can't stream music into SL without associating it to land. :(

McW
_____________________


Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
ok
03-10-2005 07:58
ok ok so my wording was inproper. Sorry let me correct myself then maybe you can help/

If i wanted to play music. COuld i do something? To basically have an item ppl purchase and can listen to my music? maybe i can sell "tapes" or "cds" with constant new music to listen to? Song pack type of thing. I wouldn exactly know how to script it to make a bunch of 10s clips sound good togeather. As well maybe theres a program that will break down mp3s into 10s clips for me?
gene Poole
"Foolish humans!"
Join date: 16 Jun 2004
Posts: 324
03-10-2005 08:31
From: Smigmee Pinkerton
ok ok so my wording was inproper. Sorry let me correct myself then maybe you can help/

If i wanted to play music. COuld i do something? To basically have an item ppl purchase and can listen to my music? maybe i can sell "tapes" or "cds" with constant new music to listen to? Song pack type of thing. I wouldn exactly know how to script it to make a bunch of 10s clips sound good togeather. As well maybe theres a program that will break down mp3s into 10s clips for me?
:D

Here's a hard lesson for the real world which also applies to SL. Of all the ideas that the average person has, 99.5% of them will be either:
(a) already tried -- and shite (which is probably why you haven't heard about them)
(b) already tried -- and good (although you haven't heard about them yet)

I love your enthusiasm, but your idea falls into category 'b'. Some people have already created these CD/tape objects that will play various copyright-infringing music. I can give you one in-world; I think it's moddable too, so you can take a peek at the script.

Don't worry, we all do this. Here are two ideas I came up with, for instance:
1) laser lawnmower (age 12) -- category 'a' -- well, I didn't get around to building a prototype, but think about it...
2) pc gamepad (age 14) -- category 'b' -- I designed it, and almost completed a prototype, but had no idea about business-related stuff so I just gave up, and a few years later, Gravis came out with the exact.same.thing. (damn.)

As for the program that splits clips, I haven't seen such a beast... so maybe cruise around with Google for a bit to see, and if there's a hole to fill, you could become famous. :)
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
03-10-2005 09:40
From: Smigmee Pinkerton
If i wanted to play music. COuld i do something? To basically have an item ppl purchase and can listen to my music? maybe i can sell "tapes" or "cds" with constant new music to listen to? Song pack type of thing. I wouldn exactly know how to script it to make a bunch of 10s clips sound good togeather. As well maybe theres a program that will break down mp3s into 10s clips for me?

I recently built myself an iPod that does exactly this. It uses notecards in its inventory to represent each song. Each notecard contains all the keys of the sound files for that song, the title of the song, artist name, etc. I can switch tracks, limit the sound range, rearange tracks, etc.

I don't sell the iPod or the music notecards for two reasons... 1) I call it an "iPod" which is copyrighted and 2) The music I uploaded and listen to on it is also copyrighted. I figure as long as I don't sell it I'm not hurting anyone. *crosses fingers*

So Gene is right. If you look around hard enough, often time you'll find that something has already been invented. But don't get discouraged. in the 4+ months I've been playing I've come up with several one-of-a-kind items. And just because something similar already exists doesn't mean you can't improve on an idea.
Smigmee Pinkerton
Unlicensed Primologist
Join date: 1 Mar 2005
Posts: 42
HHmmm Ok
03-10-2005 14:04
Ok i appriciate your "clarity" on the subject and im happy you guys think its a good idea. Still Id like to at least make one for myself in the sandbox.. maybe a few friends online .. Could you tell me how you made your ipod do that? Maybe you wanna IM me and show me it? Im on my way home from work as soon as im done typing this so.. BYE SL TIME WOOT> ... Please help i still wanna make one. :P
JustAnother Millhouse
Registered User
Join date: 26 Dec 2004
Posts: 31
03-10-2005 16:46
copy/paste from my streamswitchers notecard
Tried to give titles/genre's wherever possible.

CODE

http://toronto.etn.fm:8120/,ETN-Fm.org,Techno
http://205.188.234.38:8030,Angelfire Radio,Rock & Roll
http://64.74.207.40:8002,DIGITALLY IMPORTED,Techno
http://64.236.34.196:80/stream/1007,DIGITALLY IMPORTED,Techno
http://64.236.34.67:80/stream/1011,Music One,Techno
http://64.236.34.196:80/stream/1005,SmoothJazz.com,Smooth Jazz
http://194.171.240.230:11000,BOMBASTIC Radio,HH Rap RnB
http://SC5.audiorealm.com:11134,Unknown,Unknown
http://213.250.2.58:25220,Cai-Ba Radio,HH Rap RnB
http://209.180.174.102:8000,Matt's JazzFunk,Jazz
http://64.236.34.4:80/stream/1031,Virgin Radio,Rock & Roll
http://207.200.96.226:8048,Radio Paradise,Rock & Roll
http://195.114.88.6:8000,Frequence3,Techno
http://64.236.34.196:80/stream/1012,Smoothbeats.com,HH Rap RnB
http://64.236.34.4:80/stream/1038,HitsRadio.com,HH Rap RnB
http://64.236.34.4:80/stream/1006,Mostly Classical,Classical
http://64.236.34.4:80/stream/1040, Unknown, Mixed
http://64.62.252.134:6256, urban soul nation, HH Rap RnB
http://67.19.165.165:9010, MINX, Mixed
http://001.24server.de:12380, DOMINICK, Mixed
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
03-10-2005 17:44
That's not what Smigmee is looking for.

Smigmee, you first have to upload your favorite songs in 10-sec clips... wavs I believe. This means you need to use a sound editor program to split your tracks into as many 10-sec clips as needed. Next, you upload each 10-sec clip.... this will cost you L$10 per clip / L$60 per minute / L$240 per typical 4-minute song.

Once you've uploaded the clips, you need a script that plays them back-to-back to recreate a seamless song. There are free open-source scripts to do this. Unfortunately, the USL Library has been packed up and taken to a place unknown. This was the best place to find good scripting examples. I'm sure someone out there has a copy of a free streaming music script.
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
03-15-2005 12:40
By the way, when they say 10 second clips, that they really mean is 9.9 second clips. Because 9.9 will work perfectly, and 10.0 will fail.

I forget where I read that, but it was a good source, like a Linden said it... sorry I canna remember! Check the Wiki.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
03-15-2005 14:48
I've never heard that but it wouldn't surprise me. All my clips are exactly 10 seconds and they work well enough for my tastes. You'll run into much bigger issues when you start dealing with prebuffering, laggy sims and sound queueing. After a ton of trial and error, I eventaully decided to not even use queueing at all. It is too unpredictable.
Smiggy Pinkerton
Registered User
Join date: 16 Mar 2005
Posts: 4
Hmmm
03-16-2005 13:47
Well first off id like to let you know this IS "SMIGMEE" I got banned for a little while apparently having too much fun with C4 hehehehe. Anyways. As far as the audio files yeah i noticed that i couldnt get full 10 secs up there so i went with 9.4 for each (my audio proggy liked it) Maybe someone could tell me about a good audio program wich would split my files into 10 sec chunks automatically? As well if anyone knows of the script to link theses 10sec wav files id love to get my hands on it. Having much trouble with locating the bugger... Thanks DoteDote
Klandon Melville
Registered User
Join date: 12 Nov 2005
Posts: 14
llSetParcelMusicURL -- Isn't working
11-23-2005 06:59
I'm relatively new to scripting and trying to create an object, which when you touch it, sets the parcel's Music stream. Here's the script:

default
{
state_entry()
{
llSay(0, "Click me to turn on music here";);
}

touch_start(integer total_number)
{
llSay(0, "Changing to radio KOL.";);
llSetParcelMusicURL("http://radiokol24.kicks-ass.net:8015/";);

}
}


But it isn't wlorking. it's not changing the parcel's MusicURL. Any ideas? It compiled fine.

Klandon
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
11-23-2005 07:06
The owner of the object and the owner of the parcel of land must be the same. Group land is the usual reason for the URL not being changed. If you are using group land, deed the object to the group and it will work.
_____________________
Klandon Melville
Registered User
Join date: 12 Nov 2005
Posts: 14
Thanks -now another question
11-23-2005 08:09
Thanks for the quick answer. I'm getting close.

My long term objective is to create a "tunable radio" where you click on it, and it changes stations. Right now, I've got an object that can set the media, but doesn't "flip" properly. Here's the script:

string fred="1";
default
{
state_entry()
{
llSay(0, "Touch this Pyramid to change stations.";);
}

touch_start(integer total_number)
{

if (fred=="1";)
{
llSay(0, "Changing to radio KOL.";);
llSetParcelMusicURL("http://radiokol24.kicks-ass.net:8015/";);
fred=="0";
}
if (fred=="0";)
{
llSay(0, "Changing to classical.";);
llSetParcelMusicURL("http://205.188.215.227:8004";);
fred=="1";
}

}
}

Now, I assume the problem is that each time the object is touched, the variable fred is reset so it's not flipping. What I need is a state where I can find out what the current station is.

llParcelMediaQuery doesn't look like the right thing. But I can't find a variable that contains the current media on the parcel.

Klandon
Dagny Hemingway
Registered User
Join date: 26 Sep 2005
Posts: 3
Finding the Parcel Media
03-09-2006 04:14
llParcelMediaQuery

Will return the URL of the parcel's media.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-09-2006 04:20
Well, for a start you're not setting "fred" correctly in the if-clauses, you're using == instead of =, and even if you were, it would immediately switch back because you'd be checking for fred=="0" right after setting fred="0". Use "else if", not "if", there. (And why not use an integer instead of a string?)
1 2