# A more flexible TTS option

**URL:** <https://forums.ankiweb.net/t/a-more-flexible-tts-option/44365>\
**Category:** Suggestions\
**Created:** [May 3, 2024, 7:46pm UTC](https://forums.ankiweb.net/t/a-more-flexible-tts-option/44365 "2024-05-03T19:46:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![doubleworker](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/doubleworker/32/14967_2.png) [@doubleworker](https://forums.ankiweb.net/u/doubleworker)\
**Post date:** [May 3, 2024, 7:46pm UTC](https://forums.ankiweb.net/t/a-more-flexible-tts-option/44365/1 "2024-05-03T19:46:43Z")

</div>

I use a lot of example sentences on my cards, and I use JavaScript to display a translation when I click on a word I don’t know. I’d like to have Anki pronounce the word at the same time—but after searching the forum, it appears that [Anki processes audio tags before they can be modified](https://forums.ankiweb.net/t/modify-string-before-tts-reads-the-field-advanced/20075/5), so I can’t simply replace the tag content. If there was just some way to modify a TTS tag, or even to add one after a card has been displayed, that would be incredible. I did find this [JavaScript API for AnkiDroid TTS](https://github.com/ankidroid/Anki-Android/pull/8812), which seems to be along the lines of what I’m thinking.

If anyone can think of a workaround (that doesn’t involve a paid API), please let me know. On Mac, all the TTS voices I’ll ever need are already built-in, but the problem is accessing them. I tried using a URL scheme to pronounce clicked-on words through the Shortcuts app, but this requires switching to the Shortcuts app every time, which is more intrusive than it is helpful.
