How to control volume of TTS ?
I will assume by this that there is no way to have TTS at a different volume to the music channel volume?You can use Phone.SetVolume and set the VOLUME_MUSIC channel. It will change the TTS volume.
I have tried TTS and it's works fine. Very easy and very powerful.
However, it doesn't seem possible to adjust the volume in a physical device. Volume phone buttons doesn't work......
How can I achieve volume buttons to respond?
Sub Process_Globals
Private tts As TTS
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
tts.Initialize("tts")
End If
End Sub
Sub tts_Ready (Success As Boolean)
Log($"ready: ${Success}"$)
End Sub
Sub activity_click
SpeakWithVolume(tts, "strong", False, 1)
SpeakWithVolume(tts, "soft", False, 0.2)
End Sub
'volume should be between 0 to 1.
Private Sub SpeakWithVolume(TTSObject As TTS, Text As String, ClearQueue As Boolean, Volume As Float)
Dim m As JavaObject
Dim f As String = Volume
m.InitializeNewInstance("java.util.HashMap", Array(CreateMap("volume": f)))
Dim jo As JavaObject = TTSObject
Dim queue As Int
If ClearQueue Then queue = 0 Else queue = 1
jo.RunMethod("speak", Array(Text, queue, m))
End Sub
Not me. I tend not to answer questions in existing threads as such discussions are "unsearchable".Maybe I am wrong, but I currently have the impression that Forum members are more inclined to reply to already running threads than to new threads