Getting raw field data in custom TTS implementation

I’m being asked by users to correctly process furigana/ruby fields in AwesomeTTS, so I started looking into it but noticed that when I subclass TTSProcessPlayer, the AVtag instance which gets passed to _play is stripped of all HTML tags.

Is it possible to get the raw field data so that I can correctly process the Ruby tags ? I think the stripping happens here: anki/text.rs at main · ankitects/anki · GitHub
is it possible for me to monkey patch that strip_html_for_tts function ?

My TTS implementation: awesometts-anki-addon/ttsplayer.py at master · AwesomeTTS/awesometts-anki-addon · GitHub

Not sure it makes that much sense to read out both expression and reading at the same time - wouldn’t it better better if the user just used tts:kana:somefield?

I’m not a student of Japanese so i’m not confident i’m using the right terminology. Is your suggestion to have one field for expression, then derive the “reading” and possibly the “furigana” from that dynamically ? Then the audio generation could proceed smoothly.
This is certainly how I would proceed myself, with clean fields containing your source data. derived data can be added to other fields but can always be generated.

Can you elaborate on what you mean exactly by tts:kana:somefield? What construct is this and what is happening behind the scenes?

Anki includes built-in support for converting the easier-to-edit 'foo[bar] ’ (generated by Japanese Support - AnkiWeb) into either foo, bar, or foo with bar on top. If the user was using this standard functionality, they could use tts:kana:field to have tts only read ‘bar’ without reading ‘foo’.

If the user has used a different add-on that directly inserts ruby tags into the fields, then those built-in filters will not work, and they’ll need to put the content they want in a separate field if they want the TTS to work across platforms.

sorry you haven’t fully answered my question: what exactly happens behind the scenes when “tts:kana:field” is mentioned in a card template ? does this invoke some kind of filtering function provided by the Japanese Support add-on ?

It’s a built-in filter, defined in template_filters.rs.