Kivy for Python - Попытка загрузки аудио через SoundLoader - GStreamer не может загрузить плагины - PullRequest
0 голосов
/ 26 апреля 2019

Я пытаюсь играть музыку в приложении Kivy. Виджет появляется с кнопкой, после нажатия на кнопку играет музыка, но (!) После того, как музыка заканчивается, приложение перестает отвечать, и появляется сообщение «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()
...