Kivy for Python-尝试通过SoundLoader加载音频-GStreamer无法加载插件

时间:2019-04-26 13:18:21

标签: python kivy gstreamer

我正在尝试在Kivy App中播放音乐。小部件随按钮一起出现,单击按钮后正在播放音乐,但是(!)音乐结束后,应用程序变为“无响应”,并弹出消息“ Python停止工作”。调试屏幕中的错误代码:

C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\python.exe C:/Users/u6030283/Dropbox/PycharmProjects/PingPong/Test.py
[INFO   ] [Logger      ] Record log in C:\Users\u6030283\.kivy\logs\kivy_19-04-26_13.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
[INFO   ] [AudioGstplayer] Using Gstreamer 1.14.1.0
[INFO   ] [Audio       ] Providers: audio_gstplayer, audio_sdl2 (audio_ffpyplayer ignored)

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libass-9.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libass-9.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstassrender.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstassrender.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstpango.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstpango.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstrsvg.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libgstrsvg.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libharfbuzz-0.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libharfbuzz-0.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libpangocairo-1.0-0.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libpangocairo-1.0-0.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libpangoft2-1.0-0.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\libpangoft2-1.0-0.dll': The specified procedure could not be found.

(python.exe:14084): GStreamer-WARNING **: Failed to load plugin 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\librsvg-2-2.dll': 'C:\Users\u6030283\AppData\Local\Programs\Python\Python37-32\share\gstreamer\bin\librsvg-2-2.dll': The specified procedure could not be found.

我看到8条针对不同dll-s的错误消息

from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.core.audio import SoundLoader,Sound
from kivy.lang import Builder
Builder.load_string('''
<MenuPage>:
    BoxLayout:
        orientation:'vertical'
        Button:
            text:'song'
            on_press:root.plays()
''')

class MenuPage(Screen):
    M = SoundLoader.load('bubbles.mp3')

    def plays(self):
        if MenuPage.M.state == 'stop':
            MenuPage.M.play()
        else:
            MenuPage.M.stop()


sm = ScreenManager()
menu = MenuPage(name='menu')
sm.add_widget(menu)


class TestApp(App):
    def build(self):
        return sm

TestApp().run()

0 个答案:

没有答案