SuperMemo / iTunes Integration
This page explains how to convert text flashcards into MP3 files for use with iTunes. First SuperMemo Creator is used to create the flashcards or extract cards from a Palm SuperMemo database. Then the program's new XSLT export feature is used to create a shell script. The shell script uses the Mac OS X "say" speech synthesis command to create the audio files, which are converted into MP3 format and imported into iTunes. (Although the "say" command is not available on other operating systems such as Windows, the XSLT stylesheet could easily be modifed to use the speech synthesis command on another operating system.) Detailed instructions are below.
- Install the Lame MP3 encoder, which will be used to convert the speech audio files from AIFF to MP3 format. If you're using a Mac, one of the best ways to install Lame (and many other software tools) is to use DarwinPorts.
- Install sox, which is used to insert prompts between the question and answer. If your flashcards don't contain prompts, you don't need to install this program. As with Lame, sox can be installed using DarwinPorts.
- Install SuperMemo Creator and use it to create some flashcards. You can also use SuperMemo Creator to import flashcards from a Palm SuperMemo PDB file.
- Download and unzip SM-iTunes.zip, which contains an XSLT stylesheet that will be used to create a speech synthesis script based on your flashcards. When you unzip the file, you should see a folder called "SuperMemo-iTunes."
- From the File menu in SuperMemo Creator, choose Export / XSLT.
- In the file selection dialog box, select "speech.xsl" from the SuperMemo-iTunes folder and click the Open button.
- In the next dialog box, select a folder for the speech synthesis script (the Desktop is usually a convenient location) and give the file a name such as "speech.sh". Note the location of this file. Click the Save button, and the speech synthesis script is created.
- Next we need to run the speech synthesis script that was just created. Using the Finder, launch the Terminal application located under Applications / Utilities.
- In the terminal window, change into the directory containing the script. For example, if you saved the script to the Desktop, you would type "cd Desktop" at the terminal prompt.
- Make the script file executable: Type "chmod 750 speech.sh".
- Run the script to create the audio flashcards: Type "./speech.sh". This could take quite some time, depending on the number of flashcards.
- Next we will install an Applescript that will shuffle the flashcards in an iTunes playlist, while keeping question and answer pairs together. From the SuperMemo-iTunes folder, copy the script "Pair Tracks in Shuffled Playlist" to your iTunes script directory. This directory is located under [your-home-directory]/Library/iTunes/Scripts. When you copy the script to this folder, it appears under the script menu in iTunes.
- Launch iTunes and import the MP3 files that were just created. From the File menu, choose "Add to Library" and then select the MP3 files. You can also just drag the MP3 files onto the Library icon.
- Create an iTunes playlist and add the files to it.
- To shuffle the flashcards while keeping the question and answer pairs together, select the playlist and then run "Pair Tracks in Shuffled Playlist" from the script menu.
If you find audio flashcards useful, you might consider upgrading the voice used by the speech synthesizer. Additional voices may be purchased from companies such as Cepstral.
Contact
Your feedback is appreciated. Please me if you have any questions or comments.