Author Topic: How can i stop Hal talking to itself  (Read 7427 times)

kaf

  • Newbie
  • *
  • Posts: 7
    • View Profile
How can i stop Hal talking to itself
« on: February 29, 2004, 07:45:25 pm »
Hello all
I've just activated Hal's speech and the voice recognition part of the program. I am using a desktop mic & speakers. After saying 'Hello' down the microphone, Hal responds with its witty reply. The mic also picks this up and Hal starts responding to itself.
This continues in an endless loop. Is there any way to stop this or adding a delay to the mic response? I know the easiest option is to use a headphone/mic but the idea was to eventually integrate Hal onto the ER1 robot and interact with it via the onboard mic.

Any info is much appreciated.
Kaf
 

Rich_A

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
How can i stop Hal talking to itself
« Reply #1 on: March 01, 2004, 12:20:40 am »
Hello Kaf!
You just need to toggle the Mic "On" and "Off" as you speak to Hal. That is the way the program is designed to work. Use the Mic Switch on the Hal Skin to Toggle "On" when you speak, and then Toggle "Off" when you finish your sentence, and then wait for a response from Hal. If the Mic is still picking up sounds after you toggle it off you may need to check the sound hardware on your computer and also make sure that you are not running any other software programs that use speech recognition. I had the same problem when I first installed my Hal 5.0 but I just kept on running sound hardware tests and setups on my system until it started working right. If you can't get it to work after doing that kind of stuff you can always try reinstalling Hal. This was a hard problem for me to pin point the exact cause, but what was happening is that the mic was not shutting off properly from either Hal or my operating system (Windows XP). I think that I did end up reinstalling Hal to get it to finally work right. I'm sorry if that wasn't much help but hopefully their will be some other more helpful responses to this topic!
Regards,
Rich_A
ricramo@aol.com
« Last Edit: March 01, 2004, 12:55:47 am by Rich_A »
 

Inquisitor2004

  • Newbie
  • *
  • Posts: 16
    • View Profile
How can i stop Hal talking to itself
« Reply #2 on: March 07, 2004, 05:23:45 pm »
course, you could just buy a headset, and that way the mic will not pick up anything but your voice....   but is that just to ovious?
I hope you spent the 50-60 hours trainin it to your voice too,  otherwise simple sayings like,  "hello how are you today"  will be taken as, " Hell Hole, Thou Car Poo they say! "

you could always TYPE to it... less hassle

[:D]
Inquisitor Was Here!

Rich_A

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
How can i stop Hal talking to itself
« Reply #3 on: March 10, 2004, 06:36:47 am »
Hey Inquisitor2004,
From what I read of your posting it sounds like you are the one that things are not very obvious too! And you definitely do not have the patience required to deal with new technologies, so why are you wasting our time with your dumb crap! What you posted doesn't help a dam bit! It seems like if you tried to do speech training you would smash your fist through your computer's monitor screen after less than an hour of training and that is probably why you will be typing for the rest of your life!

Even if a new head-set mic was used there is still something wrong with either Hal or the computer that it is running on, or the mic itself. The "MIC" toggle switch on Hal is supposed to shut-off the mic for Hal and it is not doing that. I run two speech recognition programs at the same time on my computer and after I toggle the switch "OFF" on Hal, my computer's mic still works for my other program. So there is still something wrong if the mic is staying on for Hal even if it is in the "OFF" position!
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
How can i stop Hal talking to itself
« Reply #4 on: March 10, 2004, 12:38:25 pm »
quote:
Originally posted by Rich_A

Hey Inquisitor2004,
From what I read of your posting it sounds like you are the one that things are not very obvious too! And you definitely do not have the patience required to deal with new technologies, so why are you wasting our time with your dumb crap! What you posted doesn't help a dam bit! It seems like if you tried to do speech training you would smash your fist through your computer's monitor screen after less than an hour of training and that is probably why you will be typing for the rest of your life!

Even if a new head-set mic was used there is still something wrong with either Hal or the computer that it is running on, or the mic itself. The "MIC" toggle switch on Hal is supposed to shut-off the mic for Hal and it is not doing that. I run two speech recognition programs at the same time on my computer and after I toggle the switch "OFF" on Hal, my computer's mic still works for my other program. So there is still something wrong if the mic is staying on for Hal even if it is in the "OFF" position!


You just named the cause of your problem. There is only one speach recognition in the system and by leaving one turned on Hal is still monitering the spoken words. Turn off the other one and leave Hal's on and I think that you will not hav any more problems. You are the first and only person who has reported this kind of problem and now I think that you have shown what the problem is .
Bill
 

Inquisitor2004

  • Newbie
  • *
  • Posts: 16
    • View Profile
How can i stop Hal talking to itself
« Reply #5 on: March 10, 2004, 02:11:03 pm »
lol...   very good.    I offer a suggestion ( headset ),  I then make a comment in jest, and he throws all the toys out the pram.. lol..

oh well,
Inquisitor Was Here!

Rich_A

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
How can i stop Hal talking to itself
« Reply #6 on: March 17, 2004, 11:15:58 pm »
Hey Inquisitor2004,
At this point in time it looks like we are both messing things up for everyone here at the forum! Now they think that I am the one with a mic problem...lol! My system works fine with two speech recognition systems. I was only trying to help! Forget about it!
You were right...just get another dam mic or start typing instead!
Later much,
Rich_A
 

Crichton

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • http://home.gwi.net/~rlevasseur/
How can i stop Hal talking to itself
« Reply #7 on: March 18, 2004, 06:31:30 am »
really hope I'm not getting in the middle of something that will just get me in trouble, but I have an opinion on this, and I just have to say something.

For use in the ER1 robot, like Kaf said he wants to do, he really can't keep a hand on the mic.  He wants hands free operation.  Two things really need to happen here.  One, and I doubt this would ever happen.  Hal needs to be made so that he doesn't listen for input at the same time that he is actually saying something.  He should be speaking, finishing what he is saying, then listen again for the next spoken word.  Two, and I'm sure someone out there has the programming skill.  Make it so hal only replies to sentences with his name in the phrase and ignores everything else.

That way, if Kef is sitting with a friend and say something to him, hal won't react.  But if Kaf said, "Hal, how are you."  or "How are you Hal."  Then hal would respond.

That's just my opinion.  Part of that would solve the mic problem, because hal would never say anything really, that includes his own name.  So he would not respond anyway.

Just my thoughts.  No toy throwing, please.  lol
--------------------------------------------------------
Your friend, in Tormented Space,
Richard LeVasseur,
mailto:rlevasseur@prexar.com
--------------------------------------------------------

kaf

  • Newbie
  • *
  • Posts: 7
    • View Profile
How can i stop Hal talking to itself
« Reply #8 on: March 19, 2004, 06:46:32 pm »
Thanks for all your feedback folks. I have been looking at ways to stop the microphone picking up Hal's response from the speakers. Even as far as some kind of mic with auto on/off based on level of sound being picked up.
The solution was so obvious. Thanks Crichton for pointing it out!. Because Hal would be used on a robot, the robot should only respond when its name is called first. Even in Star Trek, the captn always communicates to the computer by saying "COMPUTER, EARL GREY TEA. MEDIUM HOT". The same applies here.
Here is a few lines of code to be placed into the Brain. Use the 'Hal Brain Editor' to add this script. Place it under the Function GetResponse(Byval Usersentence, Byval UserName, ect....).
This is at the top near line 0139.

Rsentence = UCase(UserSentence) 'Convert user sentence to Uppercase
Robotname = UCase(ComputerName) 'Convert HAL name to uppercase
robwords = (Split(Rsentence)) 'Split the words into array
If robwords(1) <> Robotname Then Exit Function
'If 1st word of user sentence is not HAL's name then the function exits.

The HAL program doesn't seem to mind if its name is always the first word of the sentence... but if it did, then we can simply strip out the first word of the sentence before processing the response.

Now that the speech recognition is sorted, I'll continue with interfacing HAL's response to control the ER1's API. If anyone is interested in this, I can post it on this forum.



Download Attachment: script.txt
1.13 KB
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
How can i stop Hal talking to itself
« Reply #9 on: March 20, 2004, 07:19:19 pm »
kaf,
I'd like to point out a couple of things that may help.
The following code is probably the easiest way to check if the first word in the UserSentence is your Hal's name. UserSentence is already all capitialized and has a space added to each end. There are even spaces between punctuation if used.

If Instr(1, Trim(UserSentence), ComputerName, vbTextCompare) = 1 Then
   'do something'
End If

The code above = 1 when the string variable 'ComputerName' is in UserSentence starting at the first position.

Another thing to be concerned about is any UserSentence containing Hal's name sets a flag called 'BlockSave' which blocks most of the script functions from saving any information to Hal's brain files. Using Hal's name in a sentence is good if you are giving commands that you wouldn't want Hal to remember and repeat back to you at some future day. However if you want Hal to remember something you say then don't use Hal's name in your sentences.

I hope this helps.


=vonsmith=
 

kaf

  • Newbie
  • *
  • Posts: 7
    • View Profile
How can i stop Hal talking to itself
« Reply #10 on: March 20, 2004, 08:36:19 pm »
Thanks for the help =Vonsmith=.
I wasn't sure how the UserSentence was formatted and didn't want to alter the format.
I noticed you Trim(UserSentence) to remove the space at both ends.
Can I still use Hal's name as firstword of the sentence and then strip out the name and then add the spaces back? Is the space at either end critical for the rest of the program to process correctly?
What I wanted was the Hal program to recognise a voice recognition sentence was directed at it but then to continue processing as normal but minus the Hal name at the start.

e.g.

If InStr(1, Trim(UserSentence), ComputerName, vbTextCompare) = 1 Then
   UserSentence = Right(UserSentence,(Len(UserSentence)-(Len(ComputerName)+1)))+" "
Else
   Exit Function
End If

Thanks again

Kaf
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
How can i stop Hal talking to itself
« Reply #11 on: March 20, 2004, 09:44:02 pm »
kaf,
The UserSentence is capitalized and spaces added between punctuation and on the ends so that Hal's functions can recognize whole words.

Example sentence:

UserSentence = "GOODWILL TOWARDS MEN IS GOOD."

If Instr(1, UserSentence, "WILL", vbTextCompare) > 0 Then 'do something'
If Instr(1, UserSentence, " GOOD ", vbTextCompare) > 0 Then 'do something'

The first InStr() above will be true since it detects "WILL" within "GOODWILL", but that's not what we wanted. The second InStr() will not detect "GOOD.".

The proper method is:

UserSentence = " GOODWILL TOWARDS MEN IS GOOD . "

If Instr(1, UserSentence, " WILL ", vbTextCompare) > 0 Then 'do something'
If Instr(1, UserSentence, " GOOD ", vbTextCompare) > 0 Then 'do something'

The first InStr() above will be false since the whole word "WILL" is not present, that's what we wanted. The second InStr() will properly detect " GOOD " since their are spaces on both sides.

Before using functions like Len() or code like the following, it is good practice to use the Trim() function to make certain there aren't extra spaces lurking somewhere.

If Variable = "WILL" Then 'do something'
is better as
If Trim(Variable) = "WILL" Then 'do something'

If Variable equaled " WILL" the comparison would not have had equivalency due to the leading space. Trim() does not change the value of Variable, it just "trims" it for the comparison. To trim Variable you have to do:

Variable = Trim(Variable)

To replace Hal's name in a string with a space you could use:

UserSentence = Replace(UserSentence, ComputerName, " ", 1, -1, vbTextCompare)

No matter what you do remember that the GetResponse function has a function near the top that detects the presence of Hal's name and sets the BlockSave flag to block saving certain info. That affects whether Hal remembers something or not.

Have fun experimenting.


=vonsmith=
« Last Edit: March 20, 2004, 09:44:47 pm by vonsmith »