kivyのsoundloaderでエラーになってしまうことに関してです。
以下のコードを入れると、
Python
1from kivy.core.audio import SoundLoader 2sound = SoundLoader.load('/Users/~/Desktop/Clock-Alarm05-1.mp3') 3if sound: 4 print("Sound found at %s" % sound.source) 5 print("Sound is %.3f seconds" % sound.length) 6 sound.play() 7
以下のエラーがでます。
Python
1(process:5460): GLib-GObject-WARNING **: 16:51:54.499: gsignal.c:2523: signal 'sync-message' is invalid for instance '0x7fb5b28b9940' of type '(null)' 2 Traceback (most recent call last): 3 File "sad.py", line 2, in <module> 4 sound = SoundLoader.load('/Users/~/Desktop/Clock-Alarm05-1.mp3') 5 File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/kivy/core/audio/__init__.py", line 85, in load 6 return classobj(source=filename) 7 File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/kivy/core/audio/audio_gstplayer.py", line 45, in __init__ 8 super(SoundGstplayer, self).__init__(**kwargs) 9 File "kivy/_event.pyx", line 264, in kivy._event.EventDispatcher.__init__ 10 File "kivy/properties.pyx", line 497, in kivy.properties.Property.__set__ 11 File "kivy/properties.pyx", line 544, in kivy.properties.Property.set 12 File "kivy/properties.pyx", line 599, in kivy.properties.Property.dispatch 13 File "kivy/_event.pyx", line 1248, in kivy._event.EventObservers.dispatch 14 File "kivy/_event.pyx", line 1154, in kivy._event.EventObservers._dispatch 15 File "/Users/daigomasatsugu/opt/anaconda3/lib/python3.7/site-packages/kivy/core/audio/__init__.py", line 175, in on_source 16 self.load() 17 File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/kivy/core/audio/audio_gstplayer.py", line 62, in load 18 self.player.load() 19 File "kivy/lib/gstplayer/_gstplayer.pyx", line 233, in kivy.lib.gstplayer._gstplayer.GstPlayer.load 20 kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin. Consider setting the environment variable GST_REGISTRY to a user accesible path, such as ~/registry.bin 21 22
改善方法を教えていただけたら幸いです。
あなたの回答
tips
プレビュー