2 from __future__
import (absolute_import, division,
3 print_function, unicode_literals)
8 gi.require_version(
'Gst',
'1.0')
9 from gi.repository
import Gst
13 """Base class for Gstreamer Kaldi application"""
15 """Initialize the speech components"""
17 self.
pulsesrc = Gst.ElementFactory.make(
"pulsesrc",
"pulsesrc")
19 self.
_error(
"Error loading pulsesrc GST plugin. You probably need the gstreamer1.0-pulseaudio package")
21 self.
audioconvert = Gst.ElementFactory.make(
"audioconvert",
"audioconvert")
22 self.
audioresample = Gst.ElementFactory.make(
"audioresample",
"audioresample")
23 self.
fakesink = Gst.ElementFactory.make(
"fakesink",
"fakesink")
33 """Print errors to stderr and exit program"""
34 print(
"[{}]".format(self.
type), *args, file=sys.stderr, **kwargs)