Alternative Speech Tool

Posted on
Wed Mar 29, 2023 10:40 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Alternative Speech Tool

I have been working with your Announcements Plugin for a relatively short period of time (big fan btw) so if I am overlooking it, I apologize in advance.

The FAQ says that the plugin was meant to only offers a "direct" Indigo speech hook.

So my question is what is the best approach implementing an Alternative Speech Tool and over-ride/bypass the speech hook?

Is it to replace the hook (i.e. indigo.server.speak()) with a call to another plugin capable of handling speech?

Posted on
Wed Mar 29, 2023 11:07 am
DaveL17 offline
User avatar
Posts: 6743
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Alternative Speech Tool

No problem! Glad you're liking the tool. The main focus of the plugin is for constructing complex strings, but since Indigo had a speech hook *right there* I thought I'd include it. One option would be to use an Apple Shortcuts hook, and then you could have the string spoken on any Apple device that supports Shortcuts and Speech. That would still constrain you to Apple's speech architecture.

Otherwise, I think your best bet is to have a separate Python script that connects your Announcements to your synthesizer of choice. If you go this route, I'd appreciate if you'd report back on what you chose and how you implemented it.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Apr 02, 2023 5:44 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: Alternative Speech Tool

Thanks for the suggestions.

After considering your advice, I have implemented the scripting support that you built in for my plugin. The implementation allows users to select pre-built announcements from within my plugin

However, I've encountered a challenge when it comes to building and testing announcements. When the "Speak Announcement" button is pressed, the built-in synthesizer is the one that speaks. Since the built-in synthesizer may not recognize certain speech commands, it can be challenging to build complex speech strings. Unfortunately, I see no easy way to implement redirection of the speech output for this button.

Another challenge I've faced relates to refreshing. When an announcement is triggered, it needs to be refreshed to ensure that the announcement reflects the current state of the variable or device. Without this refresh, there can be a gap between the last refresh and the current state.

For instance, I have a trigger that announces the title and artist every time a song changes when listening to Apple Music. To implement this using your plugin, the announcement needs to be refreshed, and after a 1 second delay, the state value can be used. Otherwise, the current song's information will not be spoken.

To get around this issue, I've been accessing the plugins preference file to use the Indigo substitution string. This involves accessing com.fogbert.indigoplugin.announcements.txt, in a similiar manner that your plugin does to extract the substitution string. While this workaround is effective, I'm still experimenting with other ways to do it because I question if this is the best solution.

By the way, I noticed that line 270 in the runConcurrentThread(self) was commented out. I'm curious if this was intentional or if it was mistakenly commented out. Uncommenting it seemed to resolve issues I was experiencing related to updating announcement states.

Overall, I am pleased with the progress of the implementation and appreciate your feedback.

Posted on
Sun Apr 02, 2023 5:56 am
DaveL17 offline
User avatar
Posts: 6743
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Alternative Speech Tool

I'm not sure why line 270 would be commented out. It's possible that it was accidental--I might've done it for testing and forgotten to revert it. In scanning the code, the only other places I see that command being executed are when the plugin config dialog is closed and when a device config is validated. I need to do a little more digging to be sure, but from your report it sounds like uncommenting it didn't cause any other errors. Thanks for letting me know.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Apr 02, 2023 7:59 am
DaveL17 offline
User avatar
Posts: 6743
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Alternative Speech Tool

I've just posted a new release of the plugin which should address the announcement refresh frequency. There are a few other minor revisions included.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron