Android Question SpeechRecognitionNoUI set volume to "0"

Humberto

Active Member
Licensed User
Longtime User
When I initialize speechrecognitionNoUi the volume is set to zero

B4X:
Dim Sr As SpeechRecognitionNoUI

Log ("Volume antes: " & PH.GetVolume ( PH.VOLUME_MUSIC ))
        If gStatusTelefone = "IDLE" Then
            Sr.StartListening(Main.gLang,False,False)
            Log ("Volume depois: " & PH.GetVolume ( PH.VOLUME_MUSIC ))
        End If

Volume antes: 13
Volume depois: 0

Anyone now how to prevent it?
Or I have to save the volume before and restore after?

Thanks
 

JohnC

Expert
Licensed User
Longtime User
I'm using that lib and I don't see that problem.

Try checking the volume *after* the SR is "done" (for example in the sr_EndOfSpeech event) - maybe you are checking the volume too soon.
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
B4X:
Sub sr1_EndOfSpeech
'    Activity.Title = "Recognition Ended"
    Log ( "Volume EndofSpeech.. " & PH.GetVolume ( PH.VOLUME_MUSIC) )
    Main.gFlag_Texto = True
End Sub

Volume entrada: 10
Volume EndofSpeech.. 0
 
Upvote 0
Top