This turns out to work well enough for what I want, although it's clearly aimed at doing other things. If I have to keep doing this, I'll probably hack the Java Media player thing from Sun, since they include the source code.