I’m back to language learning again – Dutch now, of course, so that I can understand my co-workers next time I visit. :) This means lots of reading and listening to dutch, not taking boring grammar courses. :) At this stage, I need the english readily available, and the best way to get that is parallel texts (dutch on the left, english on the right, nicely lined up). There aren’t many parallel texts available to buy, and they’re usually sorta boring books, so one of pete’s polyglot friends created a script that will take any two digital books (wherever you happened to get them) and turn them into a big html file, nicely aligned by sentence.
It’s a great tool – however, it’s missing a third aspect: audio. Normally I’d get my listening practice from dubbed tv (I’ve watched all 7 seasons of voyager, and most of DS9, in german) but the dutch don’t care much for dubbing, so it’s hard to get materials. :( What we do have is dutch audiobooks to match some of the parallel texts I’m reading – good quality unabridged audio, too. The problem was, you needed to play the audio in another window, making it a PITA to pause or skip around, or go on to the next file, or find your position again after shutting it all down.
So, I integrated the audio into the parallel text itself. Thanks to the html5 audio tag, I have a little control widget floating at the top of the window; you can scroll the text or pause the audio without moving the mouse anywhere. It’s in the early stages right now, so there’s no synchronization between the text and audio, and it doesn’t remember your position (although session-restore does restore the text position). I have some ideas for that, though.. :) The most annoying issue, really, is that firefox doesn’t support mp3 and half the other browsers don’t support ogg; it seems the only one supporting both is konqueror. So, I’m running it in konq :)
If you’d like to try out the script, it’s fairly simple. I have it hardcoded to expect mp3 files at the moment, but I’ll add an option for that as soon as anyone wants it. All you need is my audio.js file, jquery, and these three lines in your html head:
where files are named 01.mp3, 02.mp3, etc (or 1.mp3, 2.mp3…) and N is the minimum number of digits in a file (yeah, all my files had leading zeros and I didn’t get around to removing them).
Patches and code review are very welcome – this is only the third (or second, depending on how you count) thing I’ve written with jquery. :)