Skip to content

Installation: Audio

batterseapower edited this page Sep 13, 2010 · 5 revisions

Before audio will work, you need to install at least one audio pack into the plugin.

The audio packs that we currently have been able to find are as follows:

Source Number of sounds Format Notes URL
ChineseLessons.com 1,189 .mp3 Free, but of average quality chinese-lessons.com
ChinesePod.com Pinyin Tool 1,627 .mp3 Free, but licensing restrictions prevent redistribution chinesepod.com
SWAC Audio Files 1,000 .ogg Free, but needs an import script – which we currently lack swac-collections.org
WenLin Audio Files 1,675 .wav Commercial license wenlin.com

You can install the ChineseLessons.com sounds from right within the plugin – just open up the preferences dialog and click the button on the audio tab. To install any of the others, you’ll need to do the following:

  1. Make sure the sounds are in a reasonable format – MP3 and Ogg are best, but wave files (.wav) should also work. You can mix formats if you like.
  2. Rename the sounds so the filename consists of the the pinyin and tone number of the sound, plus the usual extension – so if my files are in MP3 format I might have “hen3.mp3”
  3. Make sure all the sounds are in the same directory
  4. Copy all the sounds into an appropriately-named subdirectory in the plugin’s “pinyin\media” directory – you can choose the name of this subdirectory freely
  5. If you’ve been successful, you should be able to restart Anki and see your sound pack listed on the Audio tab of the Pinyin Toolkit preferences dialog, along with the right number of detected audio files

Improving the ChineseLessons.com sounds

By default, the ChineseLessons.com sounds don’t sound that good. Nick Cook created this guide to help you improve the quality of the sounds if you wish to. Unfortunately we can’t redistribute the improved sounds ourselves due to licensing restrictions :-(

  1. Download Audacity (I used 1.3.7 beta, but anything should work)
    • Install and run it
    • Click “File” → “Edit chains”
    • Click “Add”
    • Name your new processor something like “Pinyin for Anki”
  2. Double click on ‘No. 1’ in the chain
    • Select “Change tempo”
    • Select “Edit parameters”
    • Change the value to 40% (this is a suggested value – faster audio makes the text-to-speech sound more natural)
  3. Double click on ‘No. 2’ in the chain
    • Select “Truncate silence”
    • Select “Edit parameters”
    • Change maximum duration to 10 and the threshold to -25
    • If you have Audacity 1.3.9 or greater, there will also be a minimum silence duration field: set that to 0
  4. Double click on ‘No. 3’ in the chain
    • Select “Export OGG” (or MP31)
  5. Click “OK” and confirm you want to save the chain
  6. Click “File” → “Apply chain”
    • Select your chain (“Pinyin for Anki”)
    • Click on “Apply to files…”
    • Select the .mp3 files downloaded

Audacity will now go through each of your MP3 files and prepare them to be used with the Pinyin Toolkit.
It will take about 10 minutes to complete as it goes through each audio file and makes the changes to around 1,000 files

The files will appear in a subdirectory from where your .mp3 files were located. You can install these into a new audio pack according to the normal instructions above.

That should give you near-optimum text-to-speech conversion for Anki! Enjoy!

If you have trouble with exporting to Ogg or MP3, you may find help here.

1 Since Anki introduced online media support, MP3 (although technically inferior to Ogg) may be a better choice as it allows web support