VB.NET Developer
New member
"One S". How do I change this? Like the title says, I am using SAPI in VB.NET 2010. I am creating a table-tennis score keeping program (just for fun), and I want it to say the score before each volley. (For those of you who do not know how the score is said when there is a tie, it is said as a plural number. For example, you would say "threes" if both players had 3 points.) I cannot get the computer to properly say it though. Is will say something like "One S" instead. My code is below.
...
If score1 = score2 Then
SpeakScore(score1 & "s") ' I have also tried SpeakScore(score1 & "'s")
Else
SpeakScore(score1 & " " & score2)
End If
...
Sub SpeakScore(ByVal TTS As String)
Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(TTS)
End Sub
I am willing to expand the code a lot if I have to, but I want to avoid having to do something like:
Select Case score1
Case 1
SpeakScore("ones")
...
Any help would be useful,
VB.NET Developer
...
If score1 = score2 Then
SpeakScore(score1 & "s") ' I have also tried SpeakScore(score1 & "'s")
Else
SpeakScore(score1 & " " & score2)
End If
...
Sub SpeakScore(ByVal TTS As String)
Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(TTS)
End Sub
I am willing to expand the code a lot if I have to, but I want to avoid having to do something like:
Select Case score1
Case 1
SpeakScore("ones")
...
Any help would be useful,
VB.NET Developer