From: James D. <ja...@am...> - 2003-06-08 08:29:42
|
Hi All, I often miss what MH said via the speech interface so went looking for a "Pardon?"-like command. The default mh/code/common/mh_control.pl has a voice command in it which does this but this has a small problem- it repeats _all_ of the last speech, so run it more than once, and you get this: 2003-06-08 09:14:27 normal: I said I said I said This is a test.=20 2003-06-08 09:14:24 normal: I said I said This is a test.=20 2003-06-08 09:14:22 normal: I said This is a test.=20 2003-06-08 09:14:19 normal: This is a test.=20 It gets recursive! The fix is to add a line to mh/code/common/mh_control.pl to remove the "I said" prefix if it is there: if (said $v_repeat_last_spoken) { ($temp =3D $Speak_Log[0]) =3D~ s/^.+?: //s; ($temp =3D $temp) =3D~ s/^I said //s; #NEW LINE 341 respond "I said $temp"; } I now have this mapped on a remote control with a bit of user code to give easy access to what MH just said, but you could trigger like any code just like a regular X10-device: $example_x10 =3D new X10_Item('A1'); if (state_now $example_x10 eq ON) { run_voice_cmd 'What did you say'; } Ideal for when you get a reminder message, but the TV was too loud to hear it. TTFN, James --- James Derrick =20 ja...@am..., Cramlington, England Beyond the Horizon of the place we lived when we were young, In a World of Magnets and Miracles. Pink Floyd. |