HomeGenie Forum
General Category => General Discussion => Topic started by: Bobpick on January 07, 2015, 04:26:33 PM
-
Right now, if there is movement on my front porch, eventually (about 1 minute later) I get an email from a program I set up.
I'd like to have the program play a wav or mp3 file so when I'm working at the computer, I know there is someone there.
Any ideas?
-
I use a X10 chime module for this, but you should be able to either have the HG server play a sound or say something. I believe if you want it to talk, you'd use something like:
Program.Say("Someone is at the front door");
I don't know the code for playing audio.
-
Or use Program.Play (http://www.homegenie.it/docs/doxy/de/d1f/class_home_genie_1_1_automation_1_1_scripting_1_1_program_helper.html#a5407b247ef935a9cb1906420209e2be1).
-
I had no idea I could add TTS.
Now, if I could only get speech working with Firefox.
-
What would the proper format be for playing a local file?
/home/pi/file.wav
Also, it asks for a waveURL. What formats are compatible (wave only presumably)?
-
Program.Play("file:///home/pi/file.wav")
If you want to use mp3 you can implement the same logic that Utility.Say does to convert it using the lame encoder bundled with HG.
https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/Service/Utility.cs#L165 (https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/Service/Utility.cs#L165)
-
Seems like it would be good for the Play utility to detect mp3 files and automatically convert them prior to playing the wave. Maybe that should be a feature request.
-
Or a pull request... ;)
I've refactored Utility.Play on my end because as it stands it only calls aplay which doesn't run on Windows. You could copy the lame encoder lines from the Say method or factor them out into a method that both Play and Say could use, then just test/case the filename for mp3/wav.
-
Hi, there's a perfect solution for your problem. Jshan has created a notification module for android. On android there's a program "voice notify" this speaks out loud all notifications via tts instant. You can add your notifications in your program, like"the garage doors are open" . I haven't had time to test it myself, but it looks really promising.
Hope this helps.
Bye, Hans