0

While making a STT app in Android Studio (Jetpack Compose). I encountered this in the SpeechRecognizer when I ran the app: STT in app I want to delete that so the UI looks more clean. Is there a way to do that?

I have thought of doing an overlay over the whole activity and just covering the popup box but I am not sure how to do that.

1 Answer 1

0

That popup is from the Google SpeechRecognizer UI, you can’t remove it directly.
You need to use the SpeechRecognizer API instead.

Example:

val recognizer = SpeechRecognizer.createSpeechRecognizer(context)
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply {
    putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
    putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault())
    putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.packageName)
}
recognizer.setRecognitionListener(object : RecognitionListener {
    override fun onResults(results: Bundle?) { /* handle results */ }
    override fun onReadyForSpeech(params: Bundle?) { /* update UI */ }
    // implement other callbacks...
})
recognizer.startListening(intent)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.