![]() |
|
How to mass add JDIC audio? - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Learning resources (http://forum.koohii.com/forum-9.html) +--- Thread: How to mass add JDIC audio? (/thread-9682.html) |
How to mass add JDIC audio? - somstuff - 2012-07-30 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... How to mass add JDIC audio? - cryptica - 2012-07-31 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/dictionary/japanese/audiomp3.php?kana=かな&kanji=漢字. 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. How to mass add JDIC audio? - Tori-kun - 2012-07-31 @cryptica: I get this error. http://is.gd/be0nO0 I configured the fields in the .py file though. How to mass add JDIC audio? - cryptica - 2012-07-31 @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. How to mass add JDIC audio? - Tori-kun - 2012-07-31 cryptica Wrote:@Tori-kun: That is strange. Is the model name correct? It should find some cards normally.Sent you an email:) How to mass add JDIC audio? - cryptica - 2012-07-31 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. How to mass add JDIC audio? - Tori-kun - 2012-08-01 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.. How to mass add JDIC audio? - cryptica - 2012-08-02 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 How to mass add JDIC audio? - Tori-kun - 2012-08-02 Cool stuff cryptica! Thank you a lot! I wish I could code, too ![]() 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. How to mass add JDIC audio? - cryptica - 2012-08-02 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. How to mass add JDIC audio? - Tori-kun - 2012-08-04 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? ![]() [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... How to mass add JDIC audio? - cryptica - 2012-08-04 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. How to mass add JDIC audio? - Tori-kun - 2012-08-05 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
How to mass add JDIC audio? - cryptica - 2012-08-06 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. How to mass add JDIC audio? - Tori-kun - 2012-08-06 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. |