diff options
author | James Simmons <nicestep@gmail.com> | 2016-01-24 21:09:03 (GMT) |
---|---|---|
committer | James Simmons <nicestep@gmail.com> | 2016-01-24 21:09:03 (GMT) |
commit | b5ceb9f4469e281da95950cf6e6bc3d2a6f9e0e2 (patch) | |
tree | 7a96d217acd5cc66ab6e72b5e3ca2e2fce81ae51 /Adding_TTS_gtk3/gst_simple_example.py | |
parent | f7fbb36e0d81f14509a96ec9d6e52a0d179017bb (diff) |
modified: gst_simple_example.py
modified: speech.py
Fix code to use Gst instead of gst.
modified: ReadEtextsTTS.py
modified: gst_simple_example.py
modified: speech.py
Diffstat (limited to 'Adding_TTS_gtk3/gst_simple_example.py')
-rwxr-xr-x | Adding_TTS_gtk3/gst_simple_example.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Adding_TTS_gtk3/gst_simple_example.py b/Adding_TTS_gtk3/gst_simple_example.py index 3962777..469c2a7 100755 --- a/Adding_TTS_gtk3/gst_simple_example.py +++ b/Adding_TTS_gtk3/gst_simple_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # # <one line to give the program's name and a brief idea of what it does.> # Copyright (C) <YEAR> <NAME> @@ -17,20 +18,24 @@ # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +import gi +gi.require_version('Gtk', '3.0') from gi.repository import Gtk -import gst +gi.require_version('Gst', '1.0') +from gi.repository import Gst +Gst.init(None) def gstmessage_cb(bus, message, pipe): - if message.type in (gst.MESSAGE_EOS, gst.MESSAGE_ERROR): - pipe.set_state(gst.STATE_NULL) + if message.type in (Gst.MessageType.EOS, Gst.MessageType.ERROR): + pipe.set_state(Gst.State.NULL) pipeline = 'espeak text="Hello, World!" ! autoaudiosink' -pipe = gst.parse_launch(pipeline) +pipe = Gst.parse_launch(pipeline) bus = pipe.get_bus() bus.add_signal_watch() bus.connect('message', gstmessage_cb, pipe) -pipe.set_state(gst.STATE_PLAYING) +pipe.set_state(Gst.State.PLAYING) Gtk.main() |