My game crashes without AVbin. What should I do?
Apparently, my game crashes if people don't have avbin installed because I have it trying to load mp3s. Any suggestions on the best way to deal with this?(log in to comment)
Comments
if pyglet.media.have_avbin:
music = pyglet.resource.media( 'py_rasta_cave_loop.ogg' )
self.player.queue( music )
Regarding the issue of this thread, I see avbin as a requirement like any other. I think it's up to the user to install it, as long as they're informed about it.
claxo on 2009/09/06 18:11:
for the pyweek compo you can put the first import into a try-except and in the except inform the user that it needs to install AVbin, with link :http://code.google.com/p/avbin/
then terminate the game.
Thats a minimal, bug related change so it is fine to reupload.
Long term, your audio module keep flags about AVbin availability, and in each service in audio you check at the very beginning the flag, returning if no avail.
You can look an example of this in my entry, look at the audio.py in src. ( sadly, while this detail works, the game is totally unfinished :( )