Trigger audio with URL API?

Hello,

I'm already using the URL API to trigger a search in Anki with a push of a button in Anki, on a given word or expression
(see bottom of this post).

Now I'm curious. I really love Anki's playback of words and phrases in comparison with TTS or soundfiles options available in Anki,
especially with enhanced packages and alternating female / male speakers.

Is there a way, using the URL API, to trigger audio from a given string of characters?
If not I think that would be amazing !

Thanks in advance for your help.
Best,

Julien
 

mikelove

皇帝
Staff member
Not at the moment, no. Legally speaking we're not really allowed to make our text-to-speech engines accessible to other apps, at least without forking over a much larger license fee, and we don't see enough interest in recorded audio these days to justify building this feature just for that.
 
I'm not sure to understand, how would Pleco's TTS be considered accessible to other apps
if Anki/URL-API would only be triggering Pleco to play phrases in itself?
I have Pleco open on the left in split screen at all time, so tt would not be another app benefiting from Pleco, just a way to avoid clicking manually every time.

I've seen this remark on lack of interest in recorded audio but that's a shame. I tried many recording and TTS options in Anki and it doesn't sound as good in my opinion as Pleco's — except maybe Pleco's TTS won't pause on commas for some reason.
 

mikelove

皇帝
Staff member
I'm not sure to understand, how would Pleco's TTS be considered accessible to other apps
if Anki/URL-API would only be triggering Pleco to play phrases in itself?
I have Pleco open on the left in split screen at all time, so tt would not be another app benefiting from Pleco, just a way to avoid clicking manually every time.
It's still legally iffy, to be honest - an API is an API even if your app is open in the foreground at the time.

We have considered adding an option to automatically play audio when a word is copied out due to split-screen clipboard monitoring - which would mean this was no longer an API call but simply a regular old Pleco word lookup - but in iOS 16 Apple is making it much harder for apps to automatically access clipboard text from other apps (you have to either tap a special button or OK an alert in order for us to see the text in the clipboard), so that may be impossible due to that.

I've seen this remark on lack of interest in recorded audio but that's a shame. I tried many recording and TTS options in Anki and it doesn't sound as good in my opinion as Pleco's — except maybe Pleco's TTS won't pause on commas for some reason.
The comma thing is odd - is this in example sentences too or only in headwords?
 
Oh ok I understand now ! Yes I guess Apple is make no one's life easy with those updates...

The comma thing I noticed when selecting a whole text in the clipboard reader and clicking the playback button.
That text does it for me with both voices I have :

凡姦人之所以起者,以上之不貴義,不敬義也。夫義者,所以限禁人之為惡與姦者也。今上不貴義,不敬義,如是,則天下之人百姓,皆有棄義之志,而有趨姦之心矣,此姦人之所以起也。

With the male voice, there is no pause on commas, only on periods.
With the female voice I get neither commas or periods to pause.
Did I miss a setting somewhere maybe?

By the way this reminds me of another detail : it would be great to have a playback button for the whole clipboard reader, not only when a selection is made.

Let me know if you need anything more specific !

Best,

Julien
 
Top