[Userscript] Play Audio Via Key Press

What is Play Audio Via Key Press
Play the audio file for the active review item via a user defined key press.

Overview
Feeling lazy? Bind any key on your keyboard to play the audio sounds for your review items.


UserSettings

Available At
GitHub

Author Notes
Hey WaniKani community! This is my first UserScript I quickly made to help with “keeping your hands on the keyboard” throughout your review lessons to speed things along. I have the code on GitHub linked here as well so if there are improvements that you have made and you want to incorporate them into the public version you can create Pull Request on GitHub and merge the changes. Thanks and enjoy!

Change log:

v1.1.1

  • Fixed bug that would carry over audio from a prior reading

v1.1.0

  • Added support for 2nd pronunciation group (4 keys can be mapped instead of 2 now)

v1.0.0

  • Initial release
3 Likes

Are you aware that J is by default a hotkey for audio?

8 Likes

Feature request: Pressing J would play audio on a vocab detail. J would play kenichi. J would play kyoko.

1 Like

Y-you’re a hotkey!

2 Likes

I’m guessing you mean J would play Kenichi and K/H would play Kyoko?

And how about for vocab with two accepted readings? Could we configure up to four keys?

1 Like

Well, thank you for the thread…I didn’t know about “J” being a hotkey for playing the audio! And seeing how my bluetooth headphones always clip the beginning of the very short audio files, I always had to use the pointer to replay…

1 Like

No. J will play Kenichi. J will play Kyoko. J will play kenichi. and so on.

1 Like

This is a problem with some headphones, bluetooth or cable-connected. I usually play something in the background to prevent this from happening, e.g. https://asoftmurmur.com/

2 Likes

As in, it would play the voices alternately?

Correct. There should be an option to play audio randomly somewhere in setting too. For two accepted readings for example. J Kenichi 1, J Kenichi 2, J Kyoko 1, J Kyoko 2. And so on.

1 Like

I already have a script for randomizing the VA

https://greasyfork.org/en/scripts/390446-wanikani-random-voice-actor

3 Likes

Aha! One more script to install!

1 Like

There’s also this, but don’t tell OPyou can change the key in this one too
https://greasyfork.org/en/scripts/390445-wanikani-hotkey-for-other-voice-actor

4 Likes

@Kumirei

Are you aware that J is by default a hotkey for audio?

Yes, it plays the Kyoko audio file.

@raephe

And how about for vocab with two accepted readings? Could we configure up to four keys?

Great point! Being able to configure a 3rd and 4th key would be helpful in those cases for sure! I will look into adding that.

@Kumirei

There’s also this, but don’t tell OPyou can change the key in this one too
https://greasyfork.org/en/scripts/390445-wanikani-hotkey-for-other-voice-actor

Haha, to late I already clicked the link! I’m making this for fun / practice though so it’s all about the journey!

3 Likes

Actually, it’s whomever is your preferred VA in the settings, but yes, Kyoko is the default setting

1 Like

Check out version 1.1.1 @raephe!

1 Like

I never thanked you for that, but I ended up using that website every day since then. It’s actually very useful. And for someone who’s always lived far from the sea, those waves are quite soothing.
So thank you!

P.S. Sorry for necroing here :bowing_man:

1 Like