Skip to content

Commit

Permalink
fix: move tts param logic to another method
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamakuprina committed Jan 25, 2024
1 parent fd56eda commit 5463619
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ class TelephonyReactions(private val bargeInDefaultProps: BargeInProperties) : J
* */
fun say(text: String, bargeIn: Boolean, tts: String? = null) = when (bargeIn) {
true -> say(text, CURRENT_CONTEXT_PATH, tts)
false -> if (tts != null) {
false -> say(text, tts)
}

/**
* Sends text to synthesis in telephony channel.
* Allows to interrupt synthesis only by phrases which we can handle in scenario.
*
* @param text to synthesis speech from text
* @param tts SSML text for telephony channel
* */
fun say(text: String, tts: String? = null): SayReaction {
return if (tts != null) {
replies.add(TextReply(text, state = currentState, tts = tts))
SayReaction.create(text)
} else say(text)
Expand Down

0 comments on commit 5463619

Please sign in to comment.