I am using google text to speech (TTS). Guys you all know it has only 100 character string support at a time. I have implemented TTS part correctly but not for greater than 100 characters. So as I said I'll get exception.
public void Read(string text) // Lets say text has length 250 (>100)
{
DeleteFile();
ReadText(text);
PlaySound();
}
I have a method to dispose audio:
public void DisposeWave()
{
if (output != null)
{
if (output.PlaybackState == NAudio.Wave.PlaybackState.Playing) output.Stop();
output.Dispose();
output = null;
}
if (stream != null)
{
stream.Dispose();
stream = null;
}
}
Also please consider i am using NAudio (using NAudio.Wave;). How can I modify this code efficiently and play entire string audio without problem.
Edited Question: When we use Google TTS you know there it will support 100 character string only at a single time. My problem is if my string is greater than 100 I will not allow to do TTS by google. So that I do want to split string into set of 100s and play the audio without conflict. How to do that?
Please help.