Interesting! I may or may not have the technical ability to carry this out. I have some basic familiarity with python scripting, AutoHotkey scripting, and general coding principals, but not with javascript or creating an Anki addon specifically. Does “using Javascript to replace the chars and acronyms” seem like something I could accomplish with my current skill set? If so how would I go about doing this? Thanks for any help that can be provided!
I’ experimented with what and does not work, as the tts is expecting a field reference.
<script>
var text = "{{Front}}";
text = text.replace(">", "greater than");
text = text.replace("<", "less than");
text = text.replace("AMS", "altered mental status");
text = text.replace("Na+", "sodium");
document.getElementById("modified").innerHTML = text;
</script>
I guess that can be accomplished by creating a similar method that this:
Let's see what other more familiar with Anki code have to say about this.
I’m afraid that won’t work, as the TTS processing happens before the text reaches the webview. There is no built in way to accomplish this across platforms at the moment, but it may come in a future update.
I previously tried that years ago for one of my decks and it did work, but my card database is now so large that the added size generating the audio files is too much for my phone. The native TTS (even without abbreviation support) is still the best option for my situation, I’ll just wait and hope for the feature to be added. Thanks.
Sorry for barging in but I have a similiar question, I’m wondering if it possibile to have some kind of restriction on tts, like “strip off text between brackets option” on the awesometts addon or regex option. Thank you.