PyBitmessage-2021-04-27/src/plugins/sound_gstreamer.py
2019-09-27 16:12:35 +05:30

19 lines
463 B
Python

# -*- coding: utf-8 -*-
"""
src/plugins/sound_gstreamer.py
===================================
"""
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst # noqa: E402
Gst.init(None)
_player = Gst.ElementFactory.make("playbin", "player")
def connect_plugin(sound_file):
"""Entry point for sound file"""
_player.set_state(Gst.State.NULL)
_player.set_property("uri", "file://" + sound_file)
_player.set_state(Gst.State.PLAYING)