mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 13:45:57 +00:00
Replace newlines with spaces in JavaScript strings.
This commit is contained in:
parent
8a16c3aec1
commit
2bb87b6312
2
TTS.gd
2
TTS.gd
|
@ -52,7 +52,7 @@ func speak(text, interrupt := true):
|
||||||
var code = """
|
var code = """
|
||||||
let utterance = new SpeechSynthesisUtterance("%s")
|
let utterance = new SpeechSynthesisUtterance("%s")
|
||||||
utterance.rate = %s
|
utterance.rate = %s
|
||||||
""" % [text, scaled_rate]
|
""" % [text.replace("\n", " "), scaled_rate]
|
||||||
if interrupt:
|
if interrupt:
|
||||||
code += """
|
code += """
|
||||||
window.speechSynthesis.cancel()
|
window.speechSynthesis.cancel()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user