Saturday 12 November 2011

RPG Music'N'SFX - a Roleplaying Aid Written in Python Pt. 1

I've been busy the last year or so with writing a little tool to play music in order to help me do the GMing. I figured there are already rules specific GM aids for The Dark Eye, but noone ever bothered writing something with music.

In order to realise this software, I first had to get some parametres straight. Using Python was already set, simply because I didn't know how to use anything else. The next thing was which GUI. This was quickly answered by using wxPython, which is based on wxWidgets, again, because I was most comfortable in using it. The last thing was a good audio library. Now that was a problem.

I wanted to have a library that could play both .mp3, .wav. and .ogg as minimum requirement and play several files of any format at the same time. I wanted to make it cross-platform, but minimum was Windows compatibility.
This proved to be quite challenging, especially that dreaded .mp3 compatibility. Most open source libraries stay well clear of .mp3, because of its licensing issues and prefer the open source format OGG VORBIS. Now this is an issue, since most people who use Windows, use .mp3 instead of .ogg files.
After some searching and trying (which also resulted in my rather amateur GStreamer with wxPython for Windows posts 1 2 3 4) I finally came across a library that would do the trick: PyAudiere. Put plainly it is an awesome library based on the C-library Audiere. It has some issues, but all in all it is a very good library to use. Unfortunately, I could never get it to work in Ubuntu, which actually led to one of my reasons to abandon Ubuntu for the xth time (for more see this post).

Anyhow, so I finally have it written and it is working... rather well actually. All I have to do, is create my own button pictures and remove all test files, since the licensing and copyright does not allow for shipping music files with it. Licensing in general is something, I don't quite understand yet, so I am going to play it safe, before I put it online and use the GNU General Public Licence ver. 3.

The only problem, I currently have is, that it will be quite a task to convince people to install all the libraries on their PCs before using it. I will try and create an installer for this instance and explain very carefully to everyone of them, what they are about to do. It is a shame, that Java's JRE is so widely used and accepted and Python's essentially same approach is not know at all. If I manage to do it, I will post here to tell you and a future me who's forgotten all about it, how I did it :)

This leaves me only with the posting of a screenshot for your viewing pleasure :) Enjoy.

No comments:

Post a Comment