public void GetVoice() { IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}"); TextToSpeechService service = new TextToSpeechService(authenticator); service.SetServiceUrl("{serviceUrl}"); var result = service.GetVoice("en-US_AllisonVoice"); Console.WriteLine(result.Result); }
public void GetVoice() { TokenOptions tokenOptions = new TokenOptions() { IamApiKey = apikey, ServiceUrl = url }; TextToSpeechService service = new TextToSpeechService(tokenOptions); var result = service.GetVoice("en-US_AllisonVoice"); Console.WriteLine(result.Result); }
public void GetVoice() { IamConfig config = new IamConfig( apikey: apikey ); TextToSpeechService service = new TextToSpeechService(config); service.SetEndpoint(url); var result = service.GetVoice("en-US_AllisonVoice"); Console.WriteLine(result.Result); }
public void Voices_Success() { service.WithHeader("X-Watson-Test", "1"); var listVoicesResult = service.ListVoices(); service.WithHeader("X-Watson-Test", "1"); var getVoiceResult = service.GetVoice( voice: allisonVoice ); Assert.IsNotNull(getVoiceResult); Assert.IsTrue(!string.IsNullOrEmpty(getVoiceResult.Result.Name)); Assert.IsNotNull(listVoicesResult); Assert.IsNotNull(listVoicesResult.Result._Voices); }
private Voice GetVoice(string voice, string customizationId = null, Dictionary <string, object> customData = null) { Console.WriteLine("\nAttempting to GetVoice()"); var result = service.GetVoice(voice: voice, customizationId: customizationId, customData: customData); if (result != null) { Console.WriteLine("GetVoice() succeeded:\n{0}", JsonConvert.SerializeObject(result, Formatting.Indented)); } else { Console.WriteLine("Failed to GetVoice()"); } return(result); }
public void GetVoice_Success() { IClient client = Substitute.For <IClient>(); IRequest request = Substitute.For <IRequest>(); client.GetAsync(Arg.Any <string>()) .Returns(request); TextToSpeechService service = new TextToSpeechService(client); var voice = "voice"; var customizationId = "customizationId"; var result = service.GetVoice(voice: voice, customizationId: customizationId); client.Received().GetAsync($"{service.ServiceUrl}/v1/voices/{voice}"); }
private void GetVoice() { Console.WriteLine(string.Format("Calling GetVoice({0})...", _voice)); var results = _textToSpeech.GetVoice(_voice); if (results != null) { Console.WriteLine(string.Format("Voice {0} found...", _voice)); Console.WriteLine(string.Format("name: {0} | language: {1} | gender: {2} | description {3}", results.Name, results.Language, results.Gender, results.Description)); } else { Console.WriteLine("Voice not found."); } }
public IEnumerator TestGetVoice() { Log.Debug("TextToSpeechServiceV1IntegrationTests", "Attempting to GetVoice..."); Voice getVoiceResponse = null; service.GetVoice( callback: (DetailedResponse <Voice> response, IBMError error) => { Log.Debug("TextToSpeechServiceV1IntegrationTests", "GetVoice result: {0}", response.Response); getVoiceResponse = response.Result; Assert.IsNotNull(getVoiceResponse); Assert.IsTrue(getVoiceResponse.Name == allisionVoice); Assert.IsNull(error); }, voice: allisionVoice ); while (getVoiceResponse == null) { yield return(null); } }