我有下面的代碼。這是Kotlin。任何想法爲什麼textToSpeech
從textToSpeech.setLanguage(Locale.UK)
是說textToSpeech
沒有參考解決?匿名Kotlin聽衆內部未解決的參考
val textToSpeech = TextToSpeech(
applicationContext,
object : TextToSpeech.OnInitListener {
override fun onInit(status: Int) {
if (status == TextToSpeech.SUCCESS) {
textToSpeech.setLanguage(Locale.UK)
}
}
})
起初,我以爲這是科特林插件錯誤的想法,但似乎它實際上無法編譯