Jump to content

Stream on script


cha100B Acer
 Share

You are about to reply to a thread that has been inactive for 941 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

1 hour ago, cha100B Acer said:

When your stream is on, the object will show that you are on air.

string tOn = "Texture for when stream is on";
string tOff = "texture for when stream is off";
string URL = "your stream url";
default
{ state_entry()
  {  llSetTimerEvent(10.0);
  }
  timer()
  {  if(URL == llGetParcelMusicURL())
     {  llSetTexture(tOn,0);
     }else
     {  llSetTexture(tOff,0);
     }
  }
}

 

  • Like 2
Link to comment
Share on other sites

21 hours ago, cha100B Acer said:

thank you.. but I cant make the object on :(

What object is "the object"? Are you trying to attach an audio stream to a face of a prim in an object? If so, the function call I used to attach an audio stream to a face of a prim in my local radio looks like this:

llSetPrimMediaParams
(
    3, 
    [
        PRIM_MEDIA_HOME_URL,    cur_url,
        PRIM_MEDIA_CURRENT_URL, cur_url,
        PRIM_MEDIA_AUTO_PLAY,   1  
    ]
);

where "3" is the face to attach-to, "cur_url" is a string giving the URL of the audio stream you want to attach.

I also made a "parcel radio", and the way it attaches an audio-stream URL to a parcel is like this:

llSetParcelMusicURL(cur_url);

where, again, "cur_url" is a string giving the URL of the audio stream you want to attach. (Though, generally, you'll have to own some land to use that one, unlike a prim radio, which requires no land, just attach it to your hand and carry it around.)

Now, whether that stream is "on" or not depends on each nearby avatar; for some it may be "on" and for some it may be "off" depending on whether they have the "start/stop all media" button turned on or off in their viewer. It may also depend on if they have their volume controls (in SL, in their OS, and possibly in their physical audio equipment -- I use all 3) turned way down, have taken their headphones off, are deaf, etc. You can't force audio to be "on" (actually heard) for anyone. You can only make it available by attaching it to either a parcel or a face of a prim in an object.

If you want to see what a complete radio (complete with viewable, editable script) looks like, go to the SL Marketplace, find the "Convoluted Sentience" store, and buy one of my radios. They're not free (they cost L$70) but the scripts can be viewed, edited, and tinkered with.

Edited by LoneWolfiNTj
mentioned where to find some radios with scripts that can be edited
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 941 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...