How to mass add JDIC audio?

Index » Learning resources

  • 1
 
Reply #1 - 2012 July 30, 3:16 pm
somstuff Member
Registered: 2012-06-18 Posts: 65

If I have a text file or anki deck, is there a way to add JDIC audio to everything? The Audio Download plugin only downloads for the current card, right? JDIC seems to be better than the GoogleTTS audio...

Reply #2 - 2012 July 31, 7:04 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

There is audio recorded by native speakers available on JapanesePod101, which is the one used by JDIC. It's under the URL http://assets.languagepod101.com/dictio … ;字. Just replace かな and 漢字 by the kana and kanji, respectively.

I wrote an Anki plugin for myself to download audio for cards in my deck and write the filename in a field. Anki shared plugin upload seems to be disabled for now, so I uploaded it here: http://pastebin.com/ZYQerXFA

It works for me, but haven't tested it that much, so use at own risk and try it on a small deck first. You need to edit the file to set model and field names correctly for your own deck first.

Reply #3 - 2012 July 31, 7:18 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

@cryptica: I get this error. http://is.gd/be0nO0

I configured the fields in the .py file though.

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
Reply #4 - 2012 July 31, 7:46 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

@Tori-kun: That is strange. Is the model name correct? It should find some cards normally.

If you want to you can send me the deck and your configuration, then I'll try it out myself.

Reply #5 - 2012 July 31, 8:25 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

cryptica wrote:

@Tori-kun: That is strange. Is the model name correct? It should find some cards normally.

If you want to you can send me the deck and your configuration, then I'll try it out myself.

Sent you an email:)

Reply #6 - 2012 July 31, 9:36 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

Fixed the error found by Tori-kun, the new version of the script is here: http://pastebin.com/Cz63NEHu

A note for usage: Be sure that the specified Kana field just contains the Kana reading of the word. It will fail if there is nothing or Kanji with Furigana in Brackets. For Kana-only words both the Kanji and Kana field need to contain the Kana.

Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

I wonder how I could add a new field to my deck for the sake of this plugin being able to read the "kana" from the "kana_field" properly.. In my "Reading" field I have [] around the reading so, furigana appear..

cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

I updated the plugin to strip all non-kana characters from the kana field string before querying for the audio. That should work for you in most cases, except when the reading is written like 駆け寄[かけよ]る which becomes けかけよる.

New version here: http://pastebin.com/L2JauhXY

Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

Cool stuff cryptica! Thank you a lot! I wish I could code, too smile

I was wondering if I can leave the "Audio not found" field empty. I don't like seeing 音無し when no audio was found on my answer card every time I review.

I was also wondering if I could re-generate the kana into a new field I could create for the deck, like "only_kana" or so, but I wonder if that's possible.

I guess the download process took about 30min. last time, but somehow I could only see one file was updated in the .media map. I guess Rikai-sama creates bogus-audio files if you are online and add some words with the Rikai-sama Offline-HTML file, as it cannot download the audio from the internet.

Reply #10 - 2012 August 02, 7:58 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

Good it works for you now :-)

As to not download audio repeatedly, the plugin skips cards for which either the audio file is already present (so if you have bogus files they won't get updated) or for which the audio field contains something other than whitespace. So if you leave the "audio not found" message empty, the plugin will try to re-download the missing media again every time, which takes some time. But you could just change it to one character like - or set the font color to the background color in Anki if it annoys you.

Writing the kana in a new field is definitely possible, it's just a matter of coding ^^ Wasn't much work based on my script, so I made a Kana update script: http://pastebin.com/pTwnQDgW

Just set NEW_KANA_FIELD to the new field name, and run the plugin once to fill the field. Then you can point KANA_FIELD of the audio plugin to that field.

Reply #11 - 2012 August 04, 9:51 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

Thank you cryptica! I could generate a "kana" field now. I was wondering, I had wrongly configured Rikai-sama for a long while, so it was saving the audio to the Audio field withou the [sound:$a] meaning without the brackets and the 'sound:' part, so a lot of cards remain looking like kana - kanji.mp3 and Anki cannot detect them as sound files...

Is there any way to clear the Audio field and re-fill it using your Audio plugin? big_smile

[Edit] I edited the fill_in.py file where to get the kana and where to put the audio and emptied my Misc.media folder, however, the plugin does not download the new audio files. It remains empty...

Last edited by Tori-kun (2012 August 04, 10:02 am)

Reply #12 - 2012 August 04, 11:20 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

You can clear the Audio field from Anki by selecting all the cards to update in the card browser, then choosing Edit -> Find and Replace from the menu, entering .* as the Find query, selecting the Audio field as In, leaving Replace With empty and checking Treat input as regular expression. Then pressing Ok should clear the Audio field.

After that with an empty media folder the plugin should try to download audio for all cards. This probably takes some time, so don't exit Anki in between.

Last edited by cryptica (2012 August 04, 11:22 am)

Reply #13 - 2012 August 05, 7:09 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

It seems to have downloaded successfullz about 1430 mp3 files. I checked the .media folder, however, after a certain time, no more new files were downloaded for some strange reason. (I knew, it would take time, but I checked network-activity and saw no new files being downloaded. Perhaps languagepod101 has a limit for downloading?)

Any clue? My deck has about 5500 cards.. I expect for something like 1000 no audio could be found, but 1430 just seems to less smile

Reply #14 - 2012 August 06, 3:36 am
cryptica Member
From: Tokyo, Japan Registered: 2011-03-18 Posts: 17

I don't really have any clue, but it could be that languagepod101 has a download restriction.

For the cards that didn't get mp3 files, did the plugin write anything in the audio field? If not, you could try to start the plugin again later to resume downloading. If it works then, the problem would with languagepod101, otherwise I guess it could be a plugin error.

Reply #15 - 2012 August 06, 6:09 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

I cleared the audio field for all cards. In the Misc.media folder 1430 mp3 files were downloaded. For example the file for えんま - 閻魔.mp3 is existant, however, the card wasn't tagged with [sound:えんま - 閻魔.mp3] as the plugin is supposed to do (right?)...

I restarted the plugin and run it over again, but it seems no new files get added (I waited like an hour).

I wonder what the error might be.

  • 1