app/src/main/java/com/example/jarvis_stts/MainActivity.kt aktualisiert
This commit is contained in:
@@ -41,20 +41,6 @@ class MainActivity : AppCompatActivity(), RecognitionListener, TextToSpeech.OnIn
|
||||
private var availableVoices = mutableListOf<Voice>()
|
||||
private var voiceNames = mutableListOf<String>()
|
||||
|
||||
// Launcher für Google Spracherkennung
|
||||
private val speechRecognizerLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) { result ->
|
||||
// Nach der Google-Eingabe starten wir Vosk wieder
|
||||
startVosk()
|
||||
|
||||
if (result.resultCode == RESULT_OK && result.data != null) {
|
||||
val spokenText = result.data!!.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS)?.get(0) ?: ""
|
||||
tvStatus.text = "Ich: $spokenText"
|
||||
webSocket?.send(spokenText)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
Reference in New Issue
Block a user