| 123456789101112131415161718192021222324252627282930 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- namespace Speech.tts {
- public class PicoTTS : 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(lang))
- arg.Add("--lang=" + lang);
- if (!String.IsNullOrEmpty(path))
- arg.Add("--wave=" + path);
- arg.Add("\"" + sentance + "\"");
- p.StartInfo.FileName = "pico2wave " + String.Join(' ', arg);
- p.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
- p.StartInfo.CreateNoWindow = true;
- return p;
- }
- public string GetName() {
- return "Pico TTS";
- }
- }
- }
|