Sub cTTS_AvailableVoices(mapVoiceData As Map)
If mapVoiceData<>Null Then
Dim lstVoice As List=mapVoiceData.Get("voices")
lstVoices.Clear
For i=0 To lstVoice.Size-1
Dim maptmp As Map=lstVoice.Get(i)
lstVoices.AddSingleLine2(maptmp.Get("name"), maptmp.Get("name")&"#"&maptmp.Get("ssmlGender"))
Next
If lstVoices.Parent=Null Then Activity.AddView(lstVoices, 0, 0, 100%x, txtSpeak.Height)
End If
End Sub
Sub lstVoices_ItemClick (Position As Int, Value As Object)
Dim strvoice As String=Value
Dim name, ssmlGender As String
'Get the name and ssmlGender
name=strvoice.SubString2(0, strvoice.IndexOf("#"))
ssmlGender=strvoice.SubString(strvoice.IndexOf("#")+1)
cTTS.setvoice3(name, ssmlGender)
ToastMessageShow("Voice changed to "&name, False)
lstVoices.RemoveView
End Sub