Tag: text to speech

匿名Kotlin监听器中未解决的引用

我有下面的代码。 这是Kotlin。 任何想法为什么来自textToSpeech.setLanguage(Locale.UK)说是没有解决textToSpeech参考? val textToSpeech = TextToSpeech( applicationContext, object : TextToSpeech.OnInitListener { override fun onInit(status: Int) { if (status == TextToSpeech.SUCCESS) { textToSpeech.setLanguage(Locale.UK) } } }) 起初我认为这是一个想法kotlin插件的错误,但它似乎实际上不能被编译