July 01, 2009

Moihang: Part 2

Yesterday, I introduced you to Moihang, our family's version of Hangman a popular word guessing game. Maria and Monica had suggested early on that we use sounds every time you pressed a keystroke. I then suggested to use different sounds for correct and missed guesses. Finally, it only made sense to play some sort of fanfare when winning and some sort of dramatic sound clip if you fail to guess the word.

Since we wanted to support Windows versions that we knew only had .NET Framework 1.1 I decided to make it the minimum Framework version. That left me P/Invoking winmm.dll for wave file sound playback. That was easy enough in Windows and I must admit that I ignorantly assumed that P/Invoking in Linux would be almost identical and just as easy...

About two solid days of Linux audio architectures and libraries research, I ended opting for programming my own shared library using ALSA. I also learned a bit about Pulseaudio, sox and esound.

You can look at how I use afileplay in Moihang here.

The other somewhat interesting thing that I tried to accomplish with the development and release of this application was to create a build system for a WinForms app that can integrate with the menus on the GNOME desktop as well as having an Inno Setup script for building the Windows Installer. Just last week I received an email from a fellow that wanted to support build systems for Linux as well as Windows programmers at his shop. He wanted to better understand the way that MonoDevelop generated Makefiles could help with that goal.

Well, I used the incredibly awesome MonoDevelop myself to create the initial build system (did a bit of manual tweaking but truly minimal) and ended up with something that autotools built quite nicely and maintainable.

I will stop talking about this now and give you the URLs already for download and further information on Moihang and the Afileplay library.

Moihang's product page.

I hope to continue improving Moihang -- time and professional obligations permitting. I want to create a Gtk# version of the UI, maybe a Maemo version as well. I want to change the actual hanging depiction from my initial “easy way out” bitmap file sequencing to a 2D drawing system (GDI+, GDK, etc.).

For now, use it if you like and give me feedback or hack it some. Enjoy!

Posted by martinf at July 1, 2009 11:28 PM
Comments

Moihang's product page link is broken

Posted by: j23tom at July 2, 2009 04:22 AM

I have correct URLs for the links. The original machine name in the link had mfconweb. It should have had www.mfconsulting.com instead.

sound-sample.cs URL
http://www.mfconsulting.com/product/moihang/sound-sample.cs.html

URL for Moihang's product page.
http://www.mfconsulting.com/product/moihang/

Posted by: Daniel Morgan at July 2, 2009 07:28 AM

Thanks for pointing the broken links. They should be fixed now. Sorry! :-S

Paco

Posted by: Paco Martinez at July 2, 2009 09:00 AM