| 123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- namespace Speech.tts {
- public class WinTTS : ISpeechSystem {
- // pico2wave --lang=de-DE --wave=/tmp/test.wav "Guten Morgen"; aplay /tmp/test.wav; rm /tmp/test.wav
- public Process GenerateTTS(string path, string voiceName, string lang, string sentance) {
- Process p = new Process();
- List<string> arg = new List<string>();
- if (!String.IsNullOrEmpty(path))
- arg.Add("--path=" + path);
- //arg.Add("--ssml");
- arg.Add("\"<speak>" + sentance + "\"</speak>");
- //p.StartInfo.FileName = "WinTTS.exe " + String.Join(' ', arg);
- p.StartInfo.FileName = "WinTTS.exe";
- p.StartInfo.Arguments = String.Join(' ', arg);
- System.Diagnostics.Debug.WriteLine("WinTTS.exe " + String.Join(' ', arg));
- p.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
- p.StartInfo.CreateNoWindow = true;
- return p;
- }
- public string GetName() {
- return "Windows TTS";
- }
- }
- }
|