static void Main(string[] args) { ServiceControl.StartHost(false); Talker talker = new Talker(); // キャスト設定 talker.Cast = "さとうささら"; // (例)音量設定 talker.Volume = 100; // 再生する文字列を取得 if (args.Length == 0 || args[0].Length == 0) { return; } string text = args[0]; // 音声ファイルを保存 if (!talker.OutputWaveToFile(text, "C:/WINDOWS/TEMP/sasara_output.wav")) { throw new System.InvalidOperationException(); } }
public Speaker() { ServiceControl.StartHost(false); _talker = new Talker { Cast = "さとうささら", Volume = 100, ToneScale = 0, }; }
internal static void Talk(string text) { ServiceControl.StartHost(false); Talker talker = new Talker(); talker.Cast = "さとうささら"; SpeakingState state = talker.Speak(text); state.Wait(); }
public void StartSasara() { if (!ServiceControl.IsHostStarted) { ServiceControl.StartHost(false); } if (talker == null) { talker = new Talker(); } }
public void StartCevio() { if (!ServiceControl.IsHostStarted) { ServiceControl.StartHost(false); this.Logger.Info($"CeVIO Remote Service, StartHost."); } if (this.cevioTalker == null) { this.cevioTalker = new Talker(); // 最初に何か有効なキャストを設定する必要がある this.cevioTalker.Cast = Talker.AvailableCasts.FirstOrDefault(); } }
public void Activate() { switch (ServiceControl.StartHost(false)) { case HostStartResult.NotRegistered: throw new Exception("インストール状態が不明です"); case HostStartResult.FileNotFound: throw new Exception("実行ファイルが見つかりません"); case HostStartResult.BootingFailed: throw new Exception("プロセスの起動に失敗しました"); case HostStartResult.HostError: throw new Exception("アプリケーション起動後、エラーにより終了しました"); } _talker = new Talker(); _talker.Cast = _libraryName; _isActive = true; }
private void Start_Click_1(object sender, EventArgs e) { //CeVIO起動 ServiceControl.StartHost(false); }