home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch11
/
tests
/
soundTest.wrl
< prev
Wrap
Text File
|
1997-03-30
|
917b
|
49 lines
#VRML V2.0 utf8
Group {
children [
DEF xform Transform {
translation -1 0 0
children [
Sound {
source DEF soundclip AudioClip {
stopTime 0
startTime 1
url "didjOver13.wav"
loop TRUE
}
minFront 10
maxFront 1000
minBack 10
maxBack 1000
}
DEF mybox Shape {
geometry Box { size 0.5 0.5 0.5 }
}
DEF touch TouchSensor{}
DEF toggle Script {
eventIn SFTime touchTime
eventOut SFTime startTime
eventOut SFTime stopTime
field SFBool isPlaying TRUE
url "vrmlscript:
function touchTime(value, time) {
if (isPlaying) {
isPlaying = FALSE;
stopTime = value;
}
else {
isPlaying = TRUE;
startTime = value;
}
}
"
}
]
}
]
}
ROUTE touch.touchTime TO toggle.touchTime
ROUTE toggle.startTime TO soundclip.startTime
ROUTE toggle.stopTime TO soundclip.stopTime