/// <summary> /// 关闭语音合成方法 /// </summary> /// <param name="service"></param> /// <param name="callback"></param> /// <returns></returns> public static async Task CloseAsync(this SynthesizerService service, Func <SynthesizerStatus, Task>?callback = null) { var option = new SynthesizerOption() { MethodName = "bb_baidu_close_synthesizer", Callback = callback }; await service.InvokeAsync(option); }
/// <summary> /// 语音合成方法 /// </summary> /// <param name="service"></param> /// <param name="text"></param> /// <param name="callback"></param> /// <returns></returns> public static async Task SynthesizerOnceAsync(this SynthesizerService service, string?text, Func <SynthesizerStatus, Task>?callback = null) { var option = new SynthesizerOption() { Text = text, MethodName = "bb_baidu_speech_synthesizerOnce", Callback = callback }; await service.InvokeAsync(option); }
private async Task OnStart() { if (ButtonText == "开始合成") { if (!string.IsNullOrEmpty(InputText)) { await SynthesizerService.SynthesizerOnceAsync(InputText, Synthesizer); } } else { await SynthesizerService.CloseAsync(Synthesizer); } }
public WashingMachineViewModel() { _washingProgramModel = new WashingProgramModel(); MainGridVisibility = Visibility.Visible; WashingProgramGridVisibility = Visibility.Hidden; WashingTimeGridVisibility = Visibility.Hidden; WashingTemperatureGridVisibility = Visibility.Hidden; WashingSummaryGridVisibility = Visibility.Hidden; OrderHistoryGridVisibility = Visibility.Hidden; WashingMachineProgramInfoVisibility = Visibility.Hidden; _eventAggregator = new EventAggregator(); _eventAggregator.Subscribe(this); _recognitionService = new RecognitionService(_eventAggregator); _synthesizerService = new SynthesizerService(); _databaseService = new DatabaseService(); _recognitionFromSentence = new RecognitionFromSentenceService(); }
public SynthesizerController(MagmaDawDbContext magmaDbContext) { synthesizerService = new SynthesizerService(magmaDbContext); responseFactory = new ResponseFactory(); }