| 256 | } |
| 257 | |
| 258 | void TTS_Linux::stop() { |
| 259 | _THREAD_SAFE_METHOD_ |
| 260 | |
| 261 | ERR_FAIL_NULL(synth); |
| 262 | for (DisplayServer::TTSUtterance &message : queue) { |
| 263 | DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); |
| 264 | } |
| 265 | if ((last_msg_id != -1) && ids.has(last_msg_id)) { |
| 266 | DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, ids[last_msg_id]); |
| 267 | } |
| 268 | queue.clear(); |
| 269 | ids.clear(); |
| 270 | last_msg_id = -1; |
| 271 | spd_cancel(synth); |
| 272 | spd_resume(synth); |
| 273 | speaking = false; |
| 274 | paused = false; |
| 275 | } |
| 276 | |
| 277 | TTS_Linux *TTS_Linux::get_singleton() { |
| 278 | return singleton; |
no test coverage detected