Closed RenNagasaki closed 7 months ago
Just found out that the resulting .wav file can't be played via WMP. VLC works but not WMP. Any ideas why? An online file analyzer gets this from the file:
I've got it all sorted out now.
Finished code for others who are interested:
`var uriBuilder = new UriBuilder(UrlBase) { Path = Path }; var query = HttpUtility.ParseQueryString(uriBuilder.Query); query["text"] = text; query["voice"] = voice + ".wav"; query["language"] = getAlltalkLanguage(language); query["output_file"] = "ignoreme.wav"; //query["autoplay"] = "true"; uriBuilder.Query = query.ToString();
using (var wc = new System.Net.WebClient()) { wc.Proxy = null; var stream = wc.OpenRead(uriBuilder.Uri); var s = new RawSourceWaveStream(stream, new WaveFormat(24000, 16, 1)); var soundOut = new WasapiOut(); //soundOut.PlaybackStopped += (, ) => { this.speechCompleted.Set(); }; soundOut.Init(s); soundOut.Volume = volume; soundOut.Play(); }`
@erew123 Sorry to impose on you again. I'm currently trying to use your streaming endpoint -> http://localhost:7851/api/tts-generate-streaming I successfully managed to request a generation but I fail to play the generated file.
When I open the url manually I get a small Audio Player, could this be the issue?
Is there like a raw endpoint which just returns the audio stream?