[Userscript] KaniWani audio

An extension for an extension! Plays the audio when you get a KaniWani review item right, to help reinforce the connection between the thing you just typed in and actual sounds.

No settings, no frills. As with any userscript, you will need to be using Tampermonkey on Chrome or Safari, or Greasemonkey on Firefox. Then just install the script from https://github.com/stephend/kaniwani-audio/raw/master/kaniwani_audio.user.js.

Some ad-blocking or other extensions may conflict with this, e.g. Privacy Badger and Disable HTML5 Autoplay, so if you have issues, try disabling those extensions for *.kaniwani.com.

TODO (if anyone is interested): interface to mute/unmute/stop playback/replay

23 Likes

So not for phones then. Other than scripts, are there any other limitations using the app may have?

Iā€™ve only tested it on Chrome on Windows, although it should work on Chrome on any OS. It wonā€™t be possible to get it to work on phones as far I know.

What do you mean by limitations?

Sometimes apps have fewer features than the websites, thatā€™s all.

Thanks for the script!

1 Like

Yeah, no phone app at all unfortunately.

works great on safari with tampermonkey. thank you!

2 Likes

Already did 100 reviews with it! :slight_smile: Seems like everything is working perfectly! ^^ Thanks for this!

Using windows chrome.

3 Likes

Maybe Iā€™m doing something wrong, the script shows active, but doesnā€™t play the audio. I have a few Chrome extenions installed (adblock, html5 autoplay disable, yomichan), as well as customized Kaniwani settings, Iā€™ll experiment during upcoming reviews to if any of those are interacting with it. Using Windows 10.

EDIT: Appears to be the HTML5 autoplay disabling extension, I disabled on Kaniwani. Appears I forgot I had done that already on Wanakani too.

1 Like

Firefox for Android can do userscripts. :wink:

3 Likes

Thank you!

1 Like

Oh, cool! Does the script work there, then?

I didnā€™t try. But every other script I have installed has worked.

This is such a great idea (!!), but the audio doesnā€™t seem to be playing anymore. Iā€™m using Chrome, I have Adblock & any other extensions that would interfere disabled.

Is anyone else having this issue?

Thanks!

So, it was working before but now it isnā€™t? Does the audio play correctly if you go to the vocab itemā€™s WaniKani page and play it there?

Yep, it was working when I first installed the script. The audio plays correctly across WaniKani, but not during KaniWani reviews.

OK, it still seems to be working fine on every system I have access to. Without a lot more information, thereā€™s not a lot I can do.

Does it work on other computers, or other browsers? Does it work if you turn off all extensions and other scripts, even those that couldnā€™t possibly interfere?

Any chance we could get the audio played for the entered response, and not just the first synonym? Itā€™s a bit jarring to hear the wrong audio, and even more so when itā€™s for a vocab you havenā€™t learned in WK yet.

Something like:

  1. If i-th kana element matches user answer, use i-th kanji.
  2. Otherwise, if i-th kanji element matches user answer, use i-th kanji.
  3. Otherwise, use 0-th kanji.

I could take a crack at it too, if youā€™re accepting PRs.

1 Like

Thatā€™s definitely a good idea. I am very happy to accept pull requests.

Hey there! I have just downloaded KaniWani Audio and itā€™s wonderful!. I just wanted to say that for me, the audio does not autoplay after a correct answer, it only plays when I click the ā€œKanjiā€ button.

Is this how it should work? Or should it autoplay as soon as I hit the enter key and the answer turns green?

Iā€™m using Chrome on OSX. I have disabled all my adblockers and I donā€™t have any prevent html5 audio autoplay extension.

Thank you for your hard work!

1 Like

I just tested it in Tampermonkey and it seems that there is an error in the script. The init clause that adds the DOM observer for answerPanelChanged adds it to the _detailKanji element instead.

Change line 65: kwa.observeDOM(kwa._detailKanji, function() {
To: kwa.observeDOM(kwa._answerPanel, function() {

Seems to be a copy paste error from the previous init clause above.

1 Like