I wish Ming had documentation

Documentation is a good thing. Especially for programmers. When you're working with a new API, you like to know exactly what all those functions, objects, and methods do. Otherwise, you're just kind of guessing - and that makes the programming process quite painful.

I spent much of today messing around with the Ming bindings for PHP. Ming is an open-source library for creating Flash movies. It's a nice library and pretty much perfect for what I'm trying to do - dynamically create SWF files from user-uploaded data.

The only problem with Ming is that the documentation is practically non-existent. Oh, sure, PHP has a documentation section for it, but it's largely just shell docs - auto-generated function declarations with parameters. Little to no information on what the functions actually do. Fortunately, gazb has a nice Ming example site which makes up for that. It includes basic samples of all sorts of common scenarios, so I was able to figure out the stuff I needed pretty quickly.

The problem I'm having now, however, is not with the basic usage of the library, but rather with some of the deeper details, i.e. the ones that go beyond the basic syntax and usage. In particular, I'm working with SWFSound objects, trying to bind an arbirtary, user-uploaded audio file to a button. The problem is, the Ming documentation cointains zero informtation on exactly what formats SWFSound can handle. I've tried several variations on WAV files - some work, others just produce static. Apparently SWFSound also supports some compressed formats, apparently including MP3, but I've yet to get any results with those.

So now it looks like I'm stuck with the scenario of converting all the user-uploaded audio into a known-good format before passing it off the Ming. Now I've just got to figure out how to do that. Ming seemed to like the WAV files produced by MPlayer, but we don't have that on our servers. Rather, we have FFMPEG, and Ming barfed all over itself when I tried creating the WAV files with that (meaning it segfaulted trying to write the SWF). Apparently I just don't know the magic flags to make it work.

In any event, it would be really nice to have some hard information here. But I guess that's what happens when you use extensions that are listed as experimental. Maybe I should just get an ActionScript compiler installed on the servers and write a script to populate a template source file.... Of course, that would mean I'd have to learn ActionScript.

You can reply to this entry by leaving a comment below. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.