kanji koohii FORUM
Audio Download - Anki plugin for downloading 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: Audio Download - Anki plugin for downloading JDIC audio (/thread-5397.html)

Pages: 1 2 3


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-04-11

A little late but as promised here I've finally made myself write this plugin.

How this works?
Basically you add the card and then during its review you can update audio from JDIC.

Plugin works during card review and not adding new cards since I wanted to have the option of updating some of my older cards that have poor audio.

I've tested it a little bit and so far I can tell it makes adding/updating audio very easy and less time consuming.

It's my first in Anki & Python so go easy on me.

Detailed description over at:
http://ichi2.net/anki/wiki/AudioDownload

It's licensed under WTFPL so you can do anything with it.


Audio Download - Anki plugin for downloading JDIC audio - Jarvik7 - 2010-04-11

I just checked it out and it looks nice, but it's not practical for me to use as-is. My vocab deck is 12,000+ words and I add 50-100 daily (averaged out over a week).

Right now if I come across a card lacking audio (all of mine at the minute), it takes:
-1 click to see answer of card
-mousing up to button bar
-1 click to open dialog
-mousing down to dialog box
-1 click to download & listen
-1 click to save
-vocab card is reset, so I need to answer it again and hear the audio a second time (2 clicks)

That is a total of 6 clicks, 2 listenings, and a lot of mousing just for one card (including having to answer it twice). There must be a way to reduce that down to 0 clicks for approving the audio and 1 click to reject. Perhaps clicking the button could bring up a sidebar like the jxplugin and enter "download mode", during which it would auto-download & save words (for audio-less cards) as you review and have a button to reject bad matches.

-edit-
There is also a somewhat serious bug in that you only use the kana to lookup the word. The problem is that words with the same kana might have different pitch accents. Ex:
橋 はし
端 はし
箸 はし
These all have different recordings on WWWJDIC.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-04-11

I think its still better than no audio or working with an external excel file to batch download stuff + then import to Anki.

My next goal is to add audio automatically during card creation, something like (Expression->Reading) but that will create a lot of bad matches so I don't know if its worth it.

The idea was to have the user always be the final judge.

Jarvik7 Wrote:There is also a somewhat serious bug in that you only use the kana to lookup the word. The problem is that words with the same kana might have different pitch accents. Ex:
橋 はし
端 はし
箸 はし
These all have different recordings on WWWJDIC.
Thats not a bug, thats a feature Smile I seriously wanted it to work like that, user should be responsible enough to input kanji and kana to get the best match but in case there is no perfect match you can always download something.

Btw you can save one click and just go Save without Downloading & Listening since I download it twice anyway... Sad If time permits I'll change that too.


Audio Download - Anki plugin for downloading JDIC audio - Javizy - 2010-04-11

Jarvik7 Wrote:There is also a somewhat serious bug in that you only use the kana to lookup the word. The problem is that words with the same kana might have different pitch accents. Ex:
橋 はし
端 はし
箸 はし
These all have different recordings on WWWJDIC.
Aren't 橋 and 端 themselves the same (LH)? The difference becomes apparent in what follows them, something the JDIC recordings don't show you.

I use JDIC myself. I wondered about adding sentences from smart.fm, but reviewing takes long enough as it is. I really need to start supplementing with some shadowing.

By the way, for the 12,000 cards you have already, you might want to consider using the auto-downloader in the JDIC thread and the overwrite-fields plug-in to add the references to your deck. At least you've got those ones out of the way then.


Audio Download - Anki plugin for downloading JDIC audio - nest0r - 2010-04-11

This seems awesome, thanks a lot for writing and sharing. Is a field labeled 'audio' required, in addition to the 'vocabulary' tags?

Edit: I suppose I can edit those in the .py? Is it just a matter of replacing the words in the #Tags and #Fields? (I suppose so, since it comes before the bit that says 'don't modify the rest without changing the rest of the code... ')

Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated? (51.0 or 52.0kb?) Might turn up a few false positives but worth it, methinks.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-04-11

nest0r Wrote:This seems awesome, thanks a lot for writing and sharing. Is a field labeled 'audio' required, in addition to the 'vocabulary' tags?

Edit: I suppose I can edit those in the .py? Is it just a matter of replacing the words in the #Tags and #Fields? (I suppose so, since it comes before the bit that says 'don't modify the rest without changing the rest of the code... ')
Yes you can modify it to fit your card model. I didn't test it though so I'm not 100% it works Smile

nest0r Wrote:Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated?
Haven't really thought about it but its a good idea these markers, I suppose hash should be enough for this.


Audio Download - Anki plugin for downloading JDIC audio - cb4960 - 2010-04-11

nest0r Wrote:Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated? (51.0 or 52.0kb?) Might turn up a few false positives but worth it, methinks.
Of the 128,275 available sounds clips, only three are greater than 52kb (重症急性呼吸器症候群, 選択的セロトニン再取り込み阻害薬, and プログラム制御式及びキーボード制御式のアドレス指定可能な記憶域をもつ計算器) so that should be a pretty good test.


Audio Download - Anki plugin for downloading JDIC audio - nest0r - 2010-04-11

cb4960 Wrote:
nest0r Wrote:Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated? (51.0 or 52.0kb?) Might turn up a few false positives but worth it, methinks.
Of the 128,275 available sounds clips, only three are greater than 52kb (重症急性呼吸器症候群, 選択的セロトニン再取り込み阻害薬, and プログラム制御式及びキーボード制御式のアドレス指定可能な記憶域をもつ計算器) so that should be a pretty good test.
Good grief, do I even want to know how you know that?

The part of me that doesn't trust the cloud feels a potential hint of relief...


Audio Download - Anki plugin for downloading JDIC audio - rachels - 2010-04-18

Its extremely helpful/time-saving for me and easy to use. Thanks.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-05-18

Hmm I use it constantly and it works fine for me.

From your error message I don't think its a problem with JDIC or even the download process, its just that it can't write data (mp3) into a temporary file on your disk.

Is it possible that "temporarySoundFile.mp3" in your decks media folder is used by some other program (like other Anki instance) or it has some properties set (like read only, system or things like that)?

You can try to delete this file "temporarySoundFile.mp3" and see if it helps after you succeed.

I'll try to replicate this problem when I'm at home, thanks for pointing it out.


Audio Download - Anki plugin for downloading JDIC audio - TaylorSan - 2010-05-18

I can't BELIEVE I slept on this for so long! This is the best plugin ever. I seriously have been using Audacity to record each word from the site - to me this is HUGE!

All hail thurd! Well done.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-05-19

IceCream Wrote:yeasssssssss!!!!! i got it to work!!! i was being dumb... it was a new deck, and there wasn't any media file for it yet. Thanks!!! this is going to be sosososo helpful!!!
Actually in this case its me that is dumb, should have tested how it behaves with a new deck. Thanks for finding this bug Smile


Audio Download - Anki plugin for downloading JDIC audio - Thunk - 2010-05-24

Now, after you save the audio from JDIC, it doesn't just automatically play when you hit "show answer", right?

Even after saving the audio, I still have to click on the reddish/green button and click "listen to current", right?

btw - LOVE IT!! I'm gone for a year, and I come back to this! So awesome!


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-05-27

Thunk Wrote:Now, after you save the audio from JDIC, it doesn't just automatically play when you hit "show answer", right?

Even after saving the audio, I still have to click on the reddish/green button and click "listen to current", right?

btw - LOVE IT!! I'm gone for a year, and I come back to this! So awesome!
This plugin just saves downloaded sound to the current card and adds reference (filename) to that cards "audio" field. When Anki plays said audio for a card is decided by you.

If your audio field is named "Audio" put this in either your question or answer side (Settings->Deck Properties->"Your card model"->Edit->Card templates):
Code:
%(Audio)s
If you do this audio will play when showing you a question or after you click show answer.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-08-06

Jarvik7 Wrote:There must be a way to reduce that down to 0 clicks for approving the audio and 1 click to reject. Perhaps clicking the button could bring up a sidebar like the jxplugin and enter "download mode", during which it would auto-download & save words (for audio-less cards) as you review and have a button to reject bad matches.
Somebody wrote an extension to my plugin that should do what you described Smile In Anki its called Audio Download (Extension).

Another good news is that I finally have some spare time and I decided to extend support to other languages (by using Wiktionary audio files). Should have something over the weekend but I currently don't know what languages will be supported. It will depend on how vast amounts of files Wiktionary has for that language and I can't find any information on that (http://meta.wikimedia.org/wiki/Wiktionary#List_of_Wiktionaries doesn't list audio)


Audio Download - Anki plugin for downloading JDIC audio - balloonguy - 2010-08-06

The audio files themselves don't exist on Wiktionary, they are in the Wikimedia Commons. You'll want to look at http://commons.wikimedia.org/wiki/Category:Pronunciation and its sub-categories.


Audio Download - Anki plugin for downloading JDIC audio - TaylorSan - 2010-09-29

Is anyone experiencing this not working? I've been using it for a while, and I love it (thank you!!!) but for some reason it dosn't like me right now.

I tried to get the audio for 満席 - the fields all all right and I checked the site - it has audio there - but when I try it I get the "audio is currently not available."

This has happened on a few other words tonight as well.

EDIT - I looked at the card, and it had audio.....

so I restarted anki and it works fine. I tried the plugin, and it works ok now too. I guess it was just a hickup in anki.....?

anyhow, 気にするな


Audio Download - Anki plugin for downloading JDIC audio - harhol - 2010-10-20

Bumping/pimping this amazing plugin which I only just discovered. I can still get through ~200 reviews an hour while adding audio to all my existing vocab cards. Next to AdBlock Plus this is probably my favourite supplementary thing that I've ever downloaded. Cheers thurd! Smile


Audio Download - Anki plugin for downloading JDIC audio - overture2112 - 2010-10-21

cb4960 Wrote:
nest0r Wrote:Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated? (51.0 or 52.0kb?) Might turn up a few false positives but worth it, methinks.
Of the 128,275 available sounds clips, only three are greater than 52kb (重症急性呼吸器症候群, 選択的セロトニン再取り込み阻害薬, and プログラム制御式及びキーボード制御式のアドレス指定可能な記憶域をもつ計算器) so that should be a pretty good test.
It's probably easier/safer just to check the checksum of the file though.
Code:
import hashlib
if hashlib.md5( open( filepath ).read() ).digest() in knownBads:
   # handle case of no audio available



Audio Download - Anki plugin for downloading JDIC audio - ta12121 - 2010-10-21

Oh man I forgot about this. This will make my live a living heaven (lol)


Audio Download - Anki plugin for downloading JDIC audio - nadiatims - 2010-10-22

Sweet plugin thurd Smile

For some reason the default greenish button in your plugin wasn't responding (in fact it appears to be greyed out even after clicking show answer despite having the necessary plugins and adding the necessary fields. The Audio Download (Extension) which adds a yellow button however is working so all's good.

Adding audio for every card is a little slow though because I have to move my mouse up to the download button for each card. It would be sweet if the show answer button automatically triggered the audio to download for cards currently lacking audio.

Also I have a plugin idea that could be cool. I'm not a programmer so don't know how hard it would be to implement, but it would be cool if a button could be added to show the results of a google image search for the current card. This would be useful for plants, animals, words related to Japanese culture, mythology and so on.


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-10-22

nadiatims Wrote:For some reason the default greenish button in your plugin wasn't responding (in fact it appears to be greyed out even after clicking show answer despite having the necessary plugins and adding the necessary fields. The Audio Download (Extension) which adds a yellow button however is working so all's good.
Probably some tag or field name problem, Extension changed something there so it works for some people and doesn't for others. Generally you can modify this by editing the first section of plugins code (easier than it sounds).

nadiatims Wrote:Adding audio for every card is a little slow though because I have to move my mouse up to the download button for each card. It would be sweet if the show answer button automatically triggered the audio to download for cards currently lacking audio.
Yeah its a common complaint, someday I'll have to implement this.

nadiatims Wrote:Also I have a plugin idea that could be cool. I'm not a programmer so don't know how hard it would be to implement, but it would be cool if a button could be added to show the results of a google image search for the current card. This would be useful for plants, animals, words related to Japanese culture, mythology and so on.
Sweet idea, shouldn't be that hard to implement (if google shares img urls in some useful way), maybe after JLPT...


Audio Download - Anki plugin for downloading JDIC audio - nest0r - 2010-12-12

cb4960 Wrote:
nest0r Wrote:Also: Something to keep in mind when you're, or if you're, working on making this work for adding new cards, might be a good idea to find identifying markers for the 'The audio for this clip is not available' (such as size/length) mp3s so those can be automatically eliminated? (51.0 or 52.0kb?) Might turn up a few false positives but worth it, methinks.
Of the 128,275 available sounds clips, only three are greater than 52kb (重症急性呼吸器症候群, 選択的セロトニン再取り込み阻害薬, and プログラム制御式及びキーボード制御式のアドレス指定可能な記憶域をもつ計算器) so that should be a pretty good test.
So I'm semi-convinced that both you and buonaparte have discovered a way to snag all those files.

I tried to use edict files from Breen's FTP and the link format for the audio to create links but am not smart enough to get the edict text arranged properly (kana followed by kanji). Any tips on taking a text file with kanji followed by bracketed kana and turning it into a link such as JDIC audio uses? Even better, a way to turn that edict text into an Anki deck with audio in a .media folder...

Heh, well thanks to that textmechanic site (lets you merge files line by line) I figured out how to create the .txt/links. Now the file's too big. ;p


Audio Download - Anki plugin for downloading JDIC audio - thurd - 2010-12-15

I just updated the plugin and now it should work correctly with Anki 1.1+, please update after upgrading your Anki (after 1.1 becomes stable -> official).


Audio Download - Anki plugin for downloading JDIC audio - lrob12345 - 2011-01-21

Does this extension work with Anki 1.2.2?

I have Anki 1.2.2 on Windows 7 and I installed this Audio Download plugin from http://ankisrs.net/docs/AudioDownload.html

I have Japanese Suport installed in Anki. My deck (e.g. a shared JLPT deck) has a Audio, Reading, Meaning, and Expression fields. After I show the answer and click on the green audio button, the audio I hear always just says 'The audio for this clip is currently not available and will be uploaded soon' (for really simple words that I know are available in JDIC). I've read that JDIC can return this 'unavailable clip' if somehow the URL being sent isn't in Unicode and thus it isn't really sending the correct kana or kanji. The cards I'm using now just have kana, not kanji so I hope that is supported. I thought I followed all the instructions, but can't get JDIC to return anything but the 'unavailable' clip.

These are very short (beginner-level) single words so the length of audio shouldn't be causing this.

Any help would be appreciated.