#VRML V2.0 utf8 Group { children [ #Un cone pour localiser le son Shape { geometry Cone {} appearance Appearance { material Material { diffuseColor 1 0 0 } } } # Le son Sound { # On donne un nom à l'AudioClip source DEF SON AudioClip { url "click.wav" loop FALSE startTime 0 } } # un TouchSensor pour récupérer le click DEF TouchS TouchSensor {} # Le TimeSensor DEF TimeS TimeSensor { cycleInterval 3 # 3 secondes loop FALSE # Il boucme startTime 0 # on ne démarre pas le TimeSensor } ] } # quand on clique sur le cone, on démarre le TimeSensor ROUTE TouchS.touchTime TO TimeS.startTime # à chaque cycle du TimeSensor, on démarre un son # le son démarre donc au momment du clic et redémarre trois seconde après ROUTE TimeS.cycleTime TO SON.startTime