Skip to content

Commit c0f2106

Browse files
committed
Fix tts helper
1 parent 0012d8c commit c0f2106

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package platformSpecific.tts
22

33
actual fun getTtsHelper(): TtsHelper? {
4-
return TtsHelperImpl()
4+
return TtsHelperImpl
55
}

composeApp/src/commonMain/kotlin/presentation/conversation/ConversationScreen.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ fun NewConversationScreen(conversationItem: ConversationItem) {
3333
val ttsHelper by remember { lazy { getTtsHelper() } }
3434
var isTtsSpeaking by remember { mutableStateOf(false) }
3535

36-
fun onWarmUpTts() {
37-
// TTS takes a bit of time to get ready for operation, so we need to instantiate it before actually using it.
38-
@Suppress("UNUSED_EXPRESSION")
39-
ttsHelper
40-
}
41-
4236
LaunchedEffect(conversationItem) {
4337
if (!conversationItem.isVoiceInput || ttsHelper == null) return@LaunchedEffect
4438

@@ -150,10 +144,7 @@ fun NewConversationScreen(conversationItem: ConversationItem) {
150144
voiceInputContent = {
151145
VoiceInput(
152146
onPromptChanged = conversationItem.onInput,
153-
onSubmit = {
154-
onWarmUpTts()
155-
conversationItem.onSubmit(true)
156-
}
147+
onSubmit = { conversationItem.onSubmit(true) }
157148
)
158149
},
159150
)

0 commit comments

Comments
 (0)