Packaging .wav sound on Windows 8 on Kivy.1.9.1-dev

74 views
Skip to first unread message

Anthony Seger

unread,
Jun 17, 2015, 7:59:38 AM6/17/15
to kivy-...@googlegroups.com
What's the proper correct ways packaging this test app /w sound to deploy .exe file ?
==============================================================

C:\bin\PyInstaller-2.1\CageTitle\dist>cagetitle
WARNING: file already exists but should not: C:\Users\John\AppData\Local\Temp\_MEI75042\Include\pyconfig.h
[INFO              ] [Logger      ] Record log in C:\Users\John\.kivy\logs\kivy_15-06-17_53.txt
[INFO              ] [Kivy        ] v1.9.1-dev
[INFO              ] [Python      ] v2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
[INFO              ] [Factory     ] 175 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO              ] [AudioGstplayer] Using Gstreamer 1.4.5.0
[INFO              ] [Audio       ] Providers: audio_gstplayer (audio_ffpyplayer, audio_sdl2 ignored)
[INFO              ] [OSC         ] using <thread> for socket
[INFO              ] [Window      ] Provider: sdl2
[INFO              ] [GL          ] GLEW initialization succeeded
[INFO              ] [GL          ] OpenGL version <4.0.0 - Build 10.18.10.3408>
[INFO              ] [GL          ] OpenGL vendor <Intel>
[INFO              ] [GL          ] OpenGL renderer <Intel(R) HD Graphics>
[INFO              ] [GL          ] OpenGL parsed version: 4, 0
[INFO              ] [GL          ] Shading version <4.00 - Build 10.18.10.3408>
[INFO              ] [GL          ] Texture max size <16384>
[INFO              ] [GL          ] Texture max units <16>
[INFO              ] [Window      ] auto add sdl2 input provider
[INFO              ] [Window      ] virtual keyboard not allowed, single mode, not docked

 Traceback (most recent call last):
   File "<string>", line 53, in <module>
   File "C:\bin\PyInstaller-2.1\CageTitle\build\CageTitle\out00-PYZ.pyz\kivy.app", line 798, in run
   File "<string>", line 41, in build
   File "<string>", line 13, in __init__
   File "C:\bin\PyInstaller-2.1\CageTitle\build\CageTitle\out00-PYZ.pyz\kivy.core.audio", line 70, in load
   File "C:\bin\PyInstaller-2.1\CageTitle\build\CageTitle\out00-PYZ.pyz\kivy.core.audio.audio_gstplayer", line 45, i
   File "kivy\_event.pyx", line 271, in kivy._event.EventDispatcher.__init__ (kivy\_event.c:4933)
   File "kivy\properties.pyx", line 397, in kivy.properties.Property.__set__ (kivy\properties.c:4680)
   File "kivy\properties.pyx", line 429, in kivy.properties.Property.set (kivy\properties.c:5203)
   File "kivy\properties.pyx", line 484, in kivy.properties.Property.dispatch (kivy\properties.c:5852)
   File "kivy\_event.pyx", line 1168, in kivy._event.EventObservers.dispatch (kivy\_event.c:12152)
   File "kivy\_event.pyx", line 1074, in kivy._event.EventObservers._dispatch (kivy\_event.c:11451)
   File "C:\bin\PyInstaller-2.1\CageTitle\build\CageTitle\out00-PYZ.pyz\kivy.core.audio", line 148, in on_source
   File "C:\bin\PyInstaller-2.1\CageTitle\build\CageTitle\out00-PYZ.pyz\kivy.core.audio.audio_gstplayer", line 62, i
   File "kivy\lib\gstplayer\_gstplayer.pyx", line 233, in kivy.lib.gstplayer._gstplayer.GstPlayer.load (kivy\lib/gst
 kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin


code-snippet tested
==============

from kivy.app import App
from kivy.uix.widget import Widget 
from kivy.utils import get_color_from_hex 
from kivy.config import Config
from kivy.core.audio import SoundLoader

class CageTitle(Widget):
    
    def __init__(self, **kwargs):
        super(CageTitle, self).__init__(**kwargs)
        self.sound = SoundLoader.load('.\\assets\\coins.wav')
    
    def on_touch_down(self, touch):
        print 'touch down'
        if self.sound:
            self.sound.play()
    
    def on_touch_move(self, touch):
        print 'touch move'
    
    def on_touch_up(self, touch):
        print 'touch up'


class CageTitleApp(App):
    def build(self):
        return CageTitle()


if __name__ == '__main__':
    
    Config.set('graphics', 'width',   '300')
    Config.set('graphics', 'height',  '150')
    Config.set('graphics', 'resizable', '0')
    Config.set('input', 'mouse', 'mouse,disable_multitouch')
    
    from kivy.core.window import Window
    Window.clearcolor = get_color_from_hex('#336699')
    CageTitleApp().run()


pyinstaller ".spec" file
================

from kivy.tools.packaging.pyinstaller_hooks import install_hooks
import os
import kivy.core.video
install_hooks(globals())
gst_plugin_path = os.environ.get('GST_PLUGIN_PATH').split('lib')[0]

a = Analysis(['.\\cage\\cagetitle.py'],
             pathex=['C:\\bin\\PyInstaller-2.1\\CageTitle'],
             hiddenimports=[],
             runtime_hooks=None)

pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          name='CageTitle.exe',
          debug=False,
          strip=None,
          upx=True,
          console=True , icon='icon.ico')
coll = COLLECT(exe,
          Tree('./Cage'),
          Tree([f for f in os.environ.get('KIVY_SDL2_PATH', '').split(';') if 'bin' in f][0]),
          Tree(gst_plugin_path),
          Tree(os.path.join(gst_plugin_path, 'bin')),
          a.binaries,
          a.zipfiles,
          a.datas,
          name='CageTitle.exe',
          debug=False,
          strip=None,
          upx=True,
          console=True , icon='icon.ico')
Message has been deleted
Message has been deleted
Message has been deleted

Alexander Gonzalez Castañeda

unread,
Jul 20, 2016, 8:13:46 AM7/20/16
to Kivy users support
Anthony, do you find a solution for this problem?
I'm having the same issue, if you know something please post it here.
Reply all
Reply to author
Forward
0 new messages