Skip to content

Commit 1dccc65

Browse files
committed
Adding StopSpeaking() to TextToSpeechManager
1 parent ed1501a commit 1dccc65

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Assets/HoloToolkit/Utilities/Scripts/TextToSpeechManager.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ public void SpeakText(string text)
382382
#endif
383383
}
384384

385+
/// <summary>
386+
/// Stops text-to-speech playback.
387+
/// </summary>
388+
public void StopSpeaking()
389+
{
390+
if (audioSource.isPlaying)
391+
{
392+
audioSource.Stop();
393+
}
394+
}
395+
385396
/// <summary>
386397
/// Gets or sets the audio source where speech will be played.
387398
/// </summary>

0 commit comments

Comments
 (0)