-
Notifications
You must be signed in to change notification settings - Fork 194
Sample sentence audio #2156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Sample sentence audio #2156
Conversation
|
Tests failing. You can run |
|
Thanks for the hint, I forget it doesn't run bundled with |
|
The test issues should be resolved now. On a separate note, if you want it for review, I can give you access to my custom audio source. |
|
I wouldn't mix fetching sample sentence text from an API with the audio system. I think a more natural approach would be to extend the existing Then a user could, with some finagling, setup a workflow to add sample sentences from e.g. Tatoeba, by scanning the same word in them. This would involve using the overwrite on duplicate behavior and setting up the duplicate behaviors for each field. |
|
The entire point of the feature is that there are some people like myself who don't like TTS audio. You can already create an audio source that produces TTS audio and there is already an abundance of tools to create TTS for any given field in Anki, so adding anything like that to Yomitan does not make a lot of sense in my opinion. The main idea behind this feature is that - once mature - you would save yourself the trouble of "mining" sentence audio altogether. You could just listen to, say, 10 example sentences, get an idea of the breadth of usage and then choose the example that works best for you. After that, you're already left with a complete vocabulary or audio card without a need for any additional tools or trying to find a suitable example on "immersionkit" or anything similar. It would also be helpful in situations where you may technically have audio associated with your sentence, but that audio isn't suitable for Anki cards due to sound effects etc. |
|
I'm mostly fine with this but having to use ctrl means it doesnt work for mobile users. Not sure how this can be fixed gracefully. I think I'm okay to merge this as-is if you can fix conflicts and add the new handlebars to the docs on the settings page help modal. It's a very niche feature that I don't expect to see much use out of but it seems fine. Notably this feature existing would also allow a TTS source just fine and (to some extent) pulling example sentences from a source that is unaware of Yomitan's format (albeit probably lacking the sample sentence text). |
Allows users to configure a custom audio source with sample sentence audio and corresponding text in addition to regular term audio.
Sample sentence audio is served via a separate JSON audio source. In order to allow for this, the schema has been extended by an optional
sentencefield. One possible implementation for such an audio source can be found here: https://github.com/suuvvy/yomitan-sentence-audioIn the term audio popup, users can select their preferred audio source for sentence audio by clicking the Anki card button while holding Crtl. There are two new markers that can be mapped to Anki fields,
{sample-sentence-audio}and{sample-sentence-text}. If the user chooses a source withoutsentenceproperty as preferred sentence audio source, neither{sample-sentence-audio}nor{sample-sentence-text}are mapped. The{audio}marker remains unaffected by this.After playing audio from an audio source, that source is marked as either preferred (term) audio source or preferred sentence audio source depending on whether the underlying source has a
sentenceproperty. This also means the behavior stays the same for all existing audio sources.A demonstration of the feature can be seen in the video below (remember to unmute):
yomitan_sentence_audio.mp4
This is my first time working with the yomitan codebase, so any suggestions to improve code quality are highly appreciated.