Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activity Team/gst-plugins-espeak
(view source)
Revision as of 14:43, 9 March 2009
429 bytes added
,
14:43, 9 March 2009
→Simple Python example
Line 39:
Line 39:
==== Simple Python example ====
==== Simple Python example ====
+
+
import gtk
+
import gst<br>
+
def gstmessage_cb(bus, message, pipe):
+
if message.type in (gst.MESSAGE_EOS, gst.MESSAGE_ERROR):
+
pipe.set_state(gst.STATE_NULL)<br>
+
pipeline = 'espeak text="Hello world!" ! autoaudiosink'
+
pipe = gst.parse_launch(pipeline)<br>
+
bus = pipe.get_bus()
+
bus.add_signal_watch()
+
bus.connect('message', gstmessage_cb, pipe)<br>
+
pipe.set_state(gst.STATE_PLAYING)<br>
+
gtk.main()
==== Polyphony example ====
==== Polyphony example ====
Alsroot
Bots
,
Bureaucrats
,
Check users
,
Administrators
,
Widget editors
5,705
edits