Isac Active Member Licensed User Longtime User Feb 3, 2015 #1 Hi friends B4A, The Label4 automatically acquires a value and when this value changes I would make him talk, but currently is not talking. Maybe I have to memorize it and then compare it to? Code: If Label4.Text.Length > 0 OR Label4.Text<> Label4.Text Then tts1.Speak(Label4.Text,True) thank you
Hi friends B4A, The Label4 automatically acquires a value and when this value changes I would make him talk, but currently is not talking. Maybe I have to memorize it and then compare it to? Code: If Label4.Text.Length > 0 OR Label4.Text<> Label4.Text Then tts1.Speak(Label4.Text,True) thank you
Cableguy Expert Licensed User Longtime User Feb 3, 2015 #2 Don't use a Label. Use an Edit text view and put your ts inside the text changed event. you will need extra coding to prevent user input. Upvote 0
Don't use a Label. Use an Edit text view and put your ts inside the text changed event. you will need extra coding to prevent user input.
T Troberg Well-Known Member Licensed User Longtime User Feb 3, 2015 #3 I assume that you are setting the label from many places in your code, as you don't want to simply call it from there. My suggestion would be to add a sub to set the label and speak if need be: Code: Sub SetTTSLabel(Text as string) If Label4.Text<>Text Then Label4.Text=Text If Text<>"" Then tts1.Speak(Text,True) End If End If End Sub Then, simply, use SetTTSLabel(Text) instead of Label4.Text=Text everywhere you change the value of Label4 (except, of course, in SetTTSLabel). Upvote 0
I assume that you are setting the label from many places in your code, as you don't want to simply call it from there. My suggestion would be to add a sub to set the label and speak if need be: Code: Sub SetTTSLabel(Text as string) If Label4.Text<>Text Then Label4.Text=Text If Text<>"" Then tts1.Speak(Text,True) End If End If End Sub Then, simply, use SetTTSLabel(Text) instead of Label4.Text=Text everywhere you change the value of Label4 (except, of course, in SetTTSLabel).