Created
January 5, 2012 15:58
-
-
Save cecilemuller/1565847 to your computer and use it in GitHub Desktop.
TextToSpeech{} usage example in VRML/X3D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#VRML V2.0 utf8 | |
EXTERNPROTO TextToSpeech [ | |
exposedField SFString description | |
exposedField SFFloat pitch | |
exposedField SFFloat volume | |
exposedField SFFloat speed | |
exposedField SFBool enabled | |
eventIn SFString text | |
eventOut SFBool isActive | |
] "urn:inet:bitmanagement.de:node:TextToSpeech" | |
DEF speech TextToSpeech { | |
volume 100 | |
} | |
DEF script Script { | |
field SFNode speech USE speech | |
eventIn SFTime speak | |
directOutput TRUE | |
url "javascript: | |
function speak(){ | |
speech.text = 'Hello world'; | |
} | |
" | |
} | |
Group { | |
children [ | |
DEF sensor TouchSensor{} | |
Shape { | |
appearance Appearance{ | |
material Material{ | |
diffuseColor 0 0 0 | |
emissiveColor 0 1 0 | |
} | |
} | |
geometry Sphere{} | |
} | |
] | |
ROUTE sensor.touchTime TO script.speak | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment