Announcer discussion

Posted on
Sat Jul 28, 2012 7:24 pm
michaeldstark offline
Posts: 41
Joined: Jul 06, 2012
Location: Beaumont, Texas

Re: Announcer: Spoken Text with Fanfare Audio

It does work. You fixed it. I guess I just needed to restart EVERYTHING. Thanks for the fix

Posted on
Sat Jul 28, 2012 10:03 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer: Spoken Text with Fanfare Audio

Awesome! Glad it works!

Posted on
Mon Aug 13, 2012 12:59 am
michaeldstark offline
Posts: 41
Joined: Jul 06, 2012
Location: Beaumont, Texas

Re: Announcer discussion

After messing around with AirFoil, I seem to be having issues with the Announcer's Speech only working on the Server Computer. In other words, it seems to be working fine as long as the text that is to be spoken is typed in the Indigo "SPEAK" text field. Mine doesn't transmit any speech via AirFoil when it's typed in the Announcer's "Message to Say" field.

Posted on
Mon Aug 13, 2012 10:05 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

michaeldstark wrote:
After messing around with AirFoil, I seem to be having issues with the Announcer's Speech only working on the Server Computer. In other words, it seems to be working fine as long as the text that is to be spoken is typed in the Indigo "SPEAK" text field. Mine doesn't transmit any speech via AirFoil when it's typed in the Announcer's "Message to Say" field.

Announcer doesn't actually do anything at all related to Airfoil. It only creates a sound file with the spoken text in it then tells Play Sound to play it. Play Sound's output must be redirected by Airfoil in order for audio to be heard through Airfoil/AirPlay speakers. This is how I have my setup at home working. I use the Airfoil plugin included with Indigo Pro to tell Airfoil to use Play Sound as the source application and to connect to one or more AirPlay speakers. Once Airfoil has begun capturing the audio from Play Sound, I have Announcer announce the message (which uses Play Sound for output). Make sure that you have Airfoil capturing the audio from Play Sound before using Announcer if this is how you'd like it to work, otherwise Play Sound's audio will go through your computer's default audio output device (probably the internal speaker or a connected amp).

Posted on
Mon Sep 03, 2012 10:48 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Version 1.1.3 Released.

Download here.

This version adds additional error checking for greater scripting ease and adds an option to use the default system voice.

Posted on
Fri Jul 12, 2013 6:54 pm
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Announcer discussion

This might be an Indigo 6-b11 issue.

I can use Announcer in actions without problems. However, if I try to create an Announcer device, that device doesn't work, and throws an error whenever the device's target variable is changed:

Code: Select all
Jul 12, 2013 17:10:58
  Announcer Error                 Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 1003, in variableUpdated
  File "plugin.py", line 684, in announce
<type 'exceptions.AttributeError'>: 'Device' object has no attribute 'deviceId'


Assigning a value to the variable and then having Announcer speak that variable in two steps works without issue. So it's only the "device" instance itself.

Just wanted to let you know.

[Edit: Changed line 684 to check for dev.id == 0, and all is well. Didn't see any other references to deviceId.]

Posted on
Fri Jul 12, 2013 8:18 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Great catch! Thanks for reporting it. I stopped using the device feature in Announcer a long time ago and honestly forgot all about it (!!!), so never tested it in Indigo 6. You're right in that it's related to changes in Indigo. As of the first version of Indigo 6, devices are created differently and start out with an id of 0. Your fix is likely what I'll do to the patched version of Announcer.

Thanks again for pointing that out!

Posted on
Sat Jul 13, 2013 2:07 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Version 1.1.5 Released.

Download here.

This version fixes a bug that caused Announcer to crash when changing the value of an Indigo variable monitored by an Announcer device. (Thanks @rhanson for finding the bug).

Posted on
Sat Jul 13, 2013 2:18 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

rhanson wrote:
[Edit: Changed line 684 to check for dev.id == 0, and all is well. Didn't see any other references to deviceId.]

While looking more closely at the causes of the bug, I found that your solution did work, but it broke the use of Announcer actions. The reason is because the "announcer" method in the plugin.py file is used both by the Announcer device and the Announcer action. The use of the "dev.deviceId == 0" condition was a lazy way of testing to see if the passed object was a device (which in previous Indigo version would return 0 (zero) if the object was an Action call, and non-zero if it were a Device object). I'm not sure in exactly which version of Indigo that changed, but now Device objects only contain an "id" attribute and Action objects contain the "deviceId" attribute. Attempting to compare the value of an attribute that doesn't exist (because the "dev" variable is a Device object that doesn't have the "deviceId" attribute) results in an error rather than a False condition. So I had to change that comparison in like 684 completely. I also found that I hadn't updated the portion of the code for Announcer devices that handles the voice selection option, so I had to fix that too. Just thought I'd share since you'd dug into the code already.

Posted on
Sat Jul 13, 2013 5:23 pm
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Announcer discussion

Cool. Thanks for pushing out a fix!

Posted on
Tue Jul 30, 2013 3:20 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Version 1.1.6 Released.

Download here.

This version adds optional automatic version checking (enabled by default) and email notification (configurable in the plugin configuration window).

Posted on
Fri Feb 06, 2015 10:24 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Announcer discussion

Thank you very much for this nice plugin.
Can anyone tell me why I got this error below?
The strange thing is; the sound is working well!
(only a little bit delay)
Thanks for the help and kind regards,
John

ps; every other sound file gives this error, it doesn't matter if it is mp3, aiff or aac,
and when I drag and drop this sound file directly at the Play Sound app it's working also well.



Announcer Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 887, in announce
File "/Library/Application Support/Perceptive Automation/Indigo 6/IndigoPluginHost.app/Contents/PlugIns/appscript/reference.py", line 498, in __call__
<class 'appscript.reference.CommandError'>: Command failed:
OSERROR: -208
MESSAGE: was not type AIFF or was of bad format,corrupt
COMMAND: app(u'/Applications/Play Sound.app').play(u'Macintosh HD:private:tmp:1423239500.96.aif', at_volume=u'255', concurrence=True)

Posted on
Tue Feb 10, 2015 10:53 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Hi McJohn.

Sorry to hear about the error. I looked up the error and that appears to be the Sound Manager in Mac OS X reporting that the audio file format is corrupted. I'm not sure what's causing this because Announcer uses the built-in "say" command-line program that comes with Mac OS X to create the temporary text-to-speech audio file that appears to be causing that error. I'm unable to reproduce it myself, but my system is probably not exactly like your setup. Here are some possible troubleshooting steps that might help.

  • Restart the computer. This seems like a strange solution, but the temporary folder where the speech sound files are stored is cleaned out when the system is restarted. Perhaps restarting and clearing out that area will help.
  • After restarting and after Indigo starts up again, make sure there aren't any errors in the Indigo log related to Announcer. If there are, let me know what they are.
  • Remove all copies of the PlaySound application then re-download it and re-install it.
  • Try using a different speech synthesis voice with Announcer messages to see if that makes a difference.

If none of that helps, enable debug logging in the Announcer configuration. When the error appears again, copy and paste the error log into your reply. Be sure to get the Indigo log from the point where the announcement began to the error message.

Note that I'm in the middle of moving, so my response time may be delayed.

Posted on
Wed Feb 11, 2015 4:42 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Announcer discussion

Dear Nathan,

First of all; thanks for your time in busy times!

I did what you asked, it doesn't give the right solution.
Errors keeps coming.

But I know what it is!
I have a clock dingdong sound schedule every hour (a typical old clock sound :D ).
But it has to speak nothing, so first I set nothing into the "Message to Say field" but then I got a message warning from the plugin, so I set a space into that field.
And then I got the red errors when the schedule runs....
When I set some text to speak into that field, error is gone.
The error from the plugin is not a bad format sound file, but the space in the text field!
So, the question is; how can I use the plugin for only a sound to play?

Thanks for the help and succes with moving!

John

Posted on
Wed Feb 11, 2015 11:33 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Announcer discussion

Hi John.

Thanks for the update. That's quite helpful. I think the reason the OS X Sound Manager system is complaining with the file is because, when you tell the "say" command line program to speak only white space characters like space, tab, and return, it creates an empty sound file (no sound data at all). So when the Sound Manager (used by Play Sound to process audio) tries opening the file and finds no data, it returns an error. I need to put better error checking in the Announcer plugin to check and make sure people enter text and not just white space.

But to answer your question, as it's currently programmed, you really can't use Announcer to only play sound files without speech. However, you can use embedded AppleScripts in Indigo to do that. Below is an example of AppleScript that will do that. Put the path to your audio file for the POSIX file path below.

Code: Select all
set myFile to POSIX file "/Users/your-home-directory/Music/your-sound-file.aif" as Unicode text
tell application "Play Sound"
   play myFile with concurrent
end tell

Be sure to include the "as Unicode text" as Play Sound won't play the file without that. The "with concurrent" option for Play Sound is so it will play the audio in the background.

Who is online

Users browsing this forum: No registered users and 1 guest

cron