Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Music Music_Jukebox  

Music_Jukebox

Place this script in an object. If you want to play your own music, change the url variable and upload the sounds into this directory as 1.ogg, 2.ogg etc. Enter the title in the music list, 1.ogg the first entry etc. llSetParcelMusicURL works only, if the owner of the object is the owner of the land where the object is placed. To start a music, touch the object.

Category: Music
By : Shine Renoir
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Music_Jukebox
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Music_Jukebox_1.lsl
1 // Jukebox Music Script
2
3 // 2007 Copyright by Shine Renoir (fb@frank-buss.de)
4
5 // Use it for whatever you want, but keep this copyright notice
6
7 // and credit my name in notecards etc., if you use it in
8
9 // closed source objects
10
11 //
12
13 // Don't forget to change the music URL, if you use it
14
15
16
17 list music = [
18
19 "Chant de nuit, Artist: Dreamer, Album: Demo",
20
21 "Court Métrage N°1 - Ehma, Artist: Le Consortium des Artistes Libres, Album: The Urban Tale",
22
23 "Emptiness, Artist: Alexander Blu, Album: May",
24
25 "Sensitive part, Artist: arnoldsrecords, Album: Our own ways Out",
26
27 "Suite Irlandaise, Artist: Avel Glas, Album: Vent Bleu",
28
29 "Ploneïs, Artist: Avel Glas, Album: Vent Bleu",
30
31 "Cosmo, Artist: Alexander Blu, Album: May" ];
32
33
34
35 string url = "http://www.frank-buss.de/sl/";
36
37 default
38
39 {
40
42
43 {
44
45 // show dialog with available musics
46
47 llDialog(llGetOwner(), "Select free music from http://www.jamendo.com/", [
48
49 "Chant de nuit",
50
51 "Cosmo",
52
53 "stop music",
54
55 "Emptiness",
56
57 "Ploneïs",
58
59 "Suite Irlandaise",
60
61 "Sensitive part",
62
63 "Court Métrage N°1" ],
64
65 -45);
66
67 }
68
69
70
72
73 {
74
75 llTargetOmega(<0.0, 0.0, 1.0>, 0.2, 1);
76
77 llListen(-45, "", NULL_KEY, "");
78
79 }
80
81
82
83 listen(integer channel,string name,key id,string msg)
84
85 {
86
87 if(msg == "stop music") {
88
89 // setting URL to empty string stops music playback
90
92
93 } else {
94
95 // search position in music list
96
97 integer len = llGetListLength(music);
98
99 integer i;
100
101 for (i = 0; i < len; i++) {
102
103 string info = llList2String(music, i);
104
105 if(llGetSubString(info, 0, llStringLength(msg) - 1) == msg) {
106
107 // show info
108
109 llWhisper(0, "loading music: " + info + "...");
110
111 llWhisper(0, "click the play button at screen bottom");
112
113
114
115 // stop previous music
116
118
119
120
121 // musics are named 1.ogg, 2.ogg etc.
122
123 llSetParcelMusicURL(url + (string) (i+1) + ".ogg");
124
125 }
126
127 }
128
129 }
130
131 }
132
133 }

Back to the Best Free Tools in Second Life and OpenSim.