wjrm500 / LexiDeck

0 stars 0 forks source link

[Feature Request] Audio #1

Open cachandlerdev opened 10 months ago

cachandlerdev commented 10 months ago

Hi, thanks for making the project! Since I didn't see it in the readme, I was wondering if the cards have (or will have at some point in the future) audio to help learners practice their pronunciation.

I find it funny that I found your script a few weeks after I tried implementing a very similar idea that would take in epub files and lookup their definitions on Wiktionary based on word frequency. I kept having issues with the Wiktionary API due to inconsistent page formatting though, and the python library I used wasn't properly grabbing the ogg files.

wjrm500 commented 10 months ago

Hi, no worries and cheers for taking a look!

Audio is an interesting one, I think one that I thought briefly about during development but had forgotten by the time I got round to writing the README.md. My thinking was that there are two options with audio:

The first option doesn't require internet access and allows audio to be played directly from the note, while the second is probably easier to implement, keeps deck creation time in check, and generates more lightweight packages. Both rely on the existence of some third-party, free-to-use, text-to-speech service that can handle foreign languages, which isn't something I've researched at this point. If both options turn out to be viable, it could be that the user can toggle between them by setting a command-line flag, with the second option as the default.

I'm going away over the Christmas period and planning to take a break from this project in the short-term, but I'll definitely add audio to the TODOs list here, and keep you updated on any developments. Thanks!

wjrm500 commented 10 months ago

Hi @BagelSeasoning234, I've been working on the audio feature over the past couple of days and it seems to be working well. I haven't written tests for it yet so won't merge to master but if you want to use it to build a deck, just checkout the audio branch, re-build the app with pip install -e, then use the new --audio flag to add audio. If you get a chance to test it out, let me know how you find it :)