Code Monkey home page Code Monkey logo

onsei-anki's Introduction

Gitter Buy Me A Coffee donate button

Onsei Anki: Anki plugin for pitch accent practice

This addon helps you practice your Japanese pitch accent while you do your Anki reps on audio sentence cards !

It will compare your own recording with the card's sentence audio and show you where your intonation differed from it.

Screenshot

Under the hood, it is using my Onsei project. Check it out for the technical details.

IMPORTANT NOTE: THIS IS STILL A WORK IN PROGRESS, PLEASE REPORT ANY ISSUE AND SHARE IMPROVEMENT IDEAS !

Setup

For now, the following instructions have only been tested on Ubuntu Linux and with Anki 2.1.35.

  1. Copy the onsei_anki folder into the Anki addons folder.
  • On Windows: C:\Users\<YOUR_USER_NAME>\AppData\Roaming\Anki2\addons21
  • On Linux: ~/.local/share/Anki2/addons21
  • On MacOS: ~/Library/Application Support/Anki2/addons21
  1. Run Anki

  2. Configure the addon: go to the Addons menu (Ctrl+Shift+A), select Onsei and click on Config

  • Add to decks the name of the decks for which you have sentence audio cards.
  • Add to sentence_audio_fields the name of the fields where you put your sentence audio.
  • Add to sentence_transcript_fields the name of the fields where you put your sentence transcription.
  1. Restart Anki (for the changes in the configuration to apply)

Usage

  • When reviewing a card, press Shift+v to record yourself, then click the Save button to validate (or Esc to cancel).
  • The addon will automatically reveal the answer and display a graph comparing your intonation to the sentence audio.
  • You can press r to re-listen to the sentence audio, or v to re-listen to your audio

Here are two ways you can use it:

  • Repeating or shadowing exercise on Audio sentence cards (audio on front, text on back)
  • Reading exercise on Text Sentence cards (text on front, audio on back)

Running the API locally

By default, the addon will connect to an instance of Onsei API running on a distant server.

If you want to run it locally, use the following command (on Linux):

docker run --network=host itsupera/onsei-api

and change api_url to http://127.0.0.1:8000 in the addon's configuration.

Refer to the Onsei project for more details about the API.

Troubleshooting

If your problem is not described below, please report it in the Onsei community chat


Q: Graphs keep showing up even after I clicked the close button !

A: If you don't want to see the graphs anymore, disable the addon (Open Addons menu with Ctrl+Shift+A, select "Onsei" and click Disable) then restart Anki.


Q: I always get an "Error" when I record myself

A: Try to speak closer to your microphone, eliminate background noises and make a short pause before and after you speak. I might also be because the sentence audio has some background noise itself, such as a BGM.


Q: Those graphs are too big !

A: You can configure the size by changing the graph_height_in_pixels value in the addon configuration screen (Open Addons menu with Ctrl+Shift+A, select "Onsei" and click Config)

onsei-anki's People

Contributors

itsupera avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

onsei-anki's Issues

Need to have libxml installed for it to work

エラー
エラーが発生しました。Shiftキーを押した状態でAnkiを起動してください。この操作により、インストールされているアドオン全てが一時的に無効になります。
アドオン全てを無効にすると問題が起こらなくなる場合、メニューの[ツール] > [アドオン] でアドオン管理画面を開き、アドオンを1つまたはいくつか無効にしてAnkiを再起動してください。この手順を繰り返し、問題を引き起こすアドオンを特定してください。
問題を引き起こすアドオンを特定できた際は、その問題をサポートサイトアドオン・サポートサイトにご報告いただければ幸いです。
デバグ情報:
Anki 2.1.46 (6a9b4cd0) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-28 14:53:53
アドオンが関連している可能性があります:⁨Onsei⁩

Caught exception:
Traceback (most recent call last):
  File "aqt/taskman.py", line 101, in _on_closures_pending
  File "aqt/taskman.py", line 71, in <lambda>
  File "aqt/sound.py", line 605, in and_then
  File "aqt/sound.py", line 527, in stop
  File "aqt/sound.py", line 800, in after_record
  File "aqt/reviewer.py", line 1050, in after_record
  File "decorator.py", line 232, in fun
  File "anki/hooks.py", line 89, in decorator_wrapper
  File "anki/hooks.py", line 81, in repl
  File "/Users/[redacted]/Library/Application Support/Anki2/addons21/onsei_anki/hooks.py", line 64, in on_replay_recorded
    sentence = get_sentence_transcript(note)
  File "/Users/[redacted]/Library/Application Support/Anki2/addons21/onsei_anki/extract.py", line 18, in get_sentence_transcript
    soup = BeautifulSoup(note[field], features="lxml")
  File "bs4/__init__.py", line 243, in __init__
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

Possible fixes:

  • Add instructions to install libxml manually
  • Put the DLL directly in the repo
  • See if we can avoid using it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.