Public Sub StartListening(LANGUAGE As String, ONLY_RETURN_LANGUAGE_PREFERENCE As Boolean, PARTIAL_RESULTS As Boolean,PREFER_OFFLINE As Boolean)
   RecognizerIntent.Initialize("android.speech.action.RECOGNIZE_SPEECH",Null)
   RecognizerIntent.PutExtra("android.speech.extra.LANGUAGE_PREFERENCE",LANGUAGE)
   If ONLY_RETURN_LANGUAGE_PREFERENCE Then RecognizerIntent.PutExtra("android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE",LANGUAGE)
   RecognizerIntent.PutExtra("calling_package",Application.PackageName)
   RecognizerIntent.PutExtra("android.speech.extra.LANGUAGE_MODEL","free_form")
   RecognizerIntent.PutExtra("android.speech.extra.PARTIAL_RESULTS",PARTIAL_RESULTS)
   RecognizerIntent.PutExtra("android.speech.extra.PREFER_OFFLINE",PREFER_OFFLINE)
   
   
   If nosound Then
       Dim p As Phone
       volA = p.GetVolume(p.VOLUME_ALARM)
       volM = p.GetVolume(p.VOLUME_MUSIC)
       volN = p.GetVolume(p.VOLUME_NOTIFICATION)
       volR = p.GetVolume(p.VOLUME_RING)
       volS = p.GetVolume(p.VOLUME_SYSTEM)
       volV = p.GetVolume(p.VOLUME_VOICE_CALL)
       
       p.setVolume(p.VOLUME_ALARM,           0,   False)
'       p.setVolume(p.VOLUME_MUSIC,           0,   False)  - comment out to not stop music from playing
       p.setVolume(p.VOLUME_NOTIFICATION,   0,   False)
       p.setVolume(p.VOLUME_RING,           0,   False)
       p.setVolume(p.VOLUME_SYSTEM,       0,   False)
       p.setVolume(p.VOLUME_VOICE_CALL,   0,   False)
   End If
   
   JO.RunMethod("startListening",Array(RecognizerIntent))
End Sub