//Create Long Audio Dataset public void UploadLongAudioDataset(string waveZipUpload, string scriptZipUpload, string name, string description, string locale, string gender) { var properties = new Dictionary <string, string> { { "Gender", gender } }; var datasetDefinition = new DatasetDefinition(name, description, locale, properties, "CustomVoice"); var submitResponse = VoiceAPIHelper.SubmitLongAudioDataset(datasetDefinition, waveZipUpload, scriptZipUpload, CreateLongAudioDatasetUrl, this.subscriptionKey); }
public void CreateVoiceSynthesis(string name, string description, string locale, string inputTextPath, Guid modelId) { Console.WriteLine("Creating batch synthesiss."); var properties = new Dictionary <string, string> { { "ConcatenateResult", "true" } }; var model = ModelIdentity.Create(modelId); var voiceSynthesisDefinition = VoiceSynthesisDefinition.Create(name, description, locale, model, properties); var submitResponse = VoiceAPIHelper.SubmitVoiceSynthesis(voiceSynthesisDefinition, inputTextPath, VoiceSynthesisUrl, this.subscriptionKey); }
//Create Endpoint public void CreateEndpoint(string name, string description, string locale, List <ModelIdentity> ModelIds) { var endpointDefinition = new EndpointDefinition(name, description, locale, ModelIds, null, 0, false); var submitResponse = VoiceAPIHelper.Submit <EndpointDefinition>(endpointDefinition, CreateEndpointUrl, this.subscriptionKey); }
//Create Models public void CreateModel(string name, string description, string locale, string gender, List<DatasetIdentity> DatasetIds) { var properties = new Dictionary<string, string>(); properties.Add("Gender", gender); var modelDefinition = new ModelDefinition(name, description, locale, "CustomVoice", null, DatasetIds, properties); var submitResponse = VoiceAPIHelper.Submit<ModelDefinition>(modelDefinition, CreateModelUrl, this.subscriptionKey); }
public async Task<Uri> CreateVoiceSynthesis(string name, string description, string locale, string outputFormat, string inputTextPath, IEnumerable<Guid> modelIds, bool concatenateResult) { Console.WriteLine("Creating batch synthesiss."); var properties = new Dictionary<string, string>(); if (concatenateResult) { properties.Add("ConcatenateResult", "true"); } var voiceSynthesisDefinition = VoiceSynthesisDefinition.Create(name, description, locale, outputFormat, modelIds, properties); using (var submitResponse = VoiceAPIHelper.SubmitVoiceSynthesis(voiceSynthesisDefinition, inputTextPath, VoiceSynthesisUrl, this.subscriptionKey)) { return await GetLocationFromPostResponseAsync(submitResponse).ConfigureAwait(false); } }
//Create Voice Test public void CreateVoiceTest(string ModelId, string script, bool isSSML) { VoiceTestDefinition testDefinition; if (isSSML) { testDefinition = new VoiceTestDefinition(new ModelIdentity(new Guid(ModelId)), script, "SSML"); } else { testDefinition = new VoiceTestDefinition(new ModelIdentity(new Guid(ModelId)), script, "Text"); } var submitResponse = VoiceAPIHelper.Submit <VoiceTestDefinition>(testDefinition, CreateVoiceTestUrl, this.subscriptionKey); }
public void CreateBatchSynthesis(string name, string description, string locale, string inputTextPath, Guid modelId, string azureStorageConnectionString) { Console.WriteLine($"upload text to azure storage blob : {inputTextPath}"); var containerName = "voicesynthesisinputfiles"; CloudStorageAccount storageAccount = CloudStorageAccount.Parse(azureStorageConnectionString); var blobClient = storageAccount.CreateCloudBlobClient(); var containerReference = blobClient.GetContainerReference(containerName); containerReference.CreateIfNotExists(); var fileName = $"SubscriptionKey_{Guid.NewGuid().ToString()}.txt"; StorageHelper.UploadFileAsync(containerReference, fileName, inputTextPath); var textUrl = StorageHelper.GetBlobSas(blobClient, containerName, fileName, DateTime.MaxValue); Console.WriteLine("Creating batch synthesiss."); var model = ModelIdentity.Create(modelId); var batchSynthesisDefinition = BatchSynthesisDefinition.Create(name, description, locale, new Uri($"{ textUrl }"), model); var submitResponse = VoiceAPIHelper.Submit <BatchSynthesisDefinition>(batchSynthesisDefinition, VoiceSynthesisUrl, this.subscriptionKey); }
//Get VoiceTest public IEnumerable <VoiceTest> GetVoiceTests(string modelID) { return(VoiceAPIHelper.Get <VoiceTest>(this.subscriptionKey, string.Format(CultureInfo.InvariantCulture, GetVoiceTestsUrl, modelID))); }
public IEnumerable <Voice> GetVoices() { return(VoiceAPIHelper.Get <Voice>(this.subscriptionKey, GetVoicesUrl)); }
//Get Model public IEnumerable <Model> GetModels() { return(VoiceAPIHelper.Get <Model>(this.subscriptionKey, GetModelsUrl)); }
//Get Endpoint public IEnumerable <Endpoint> GetEndpoints() { return(VoiceAPIHelper.Get <Endpoint>(this.subscriptionKey, GetEndpointsUrl)); }
public void UpdateSynthesis(Guid id, string newName, string newDesc) { VoiceAPIHelper.PatchVoiceSynthesis(VoiceSynthesisUpdate.Create(newName, newDesc), this.subscriptionKey, string.Format(CultureInfo.InvariantCulture, DeleteSynthesisUrl, id.ToString())); }
//Get Dataset public IEnumerable <Dataset> GetDatasets() { return(VoiceAPIHelper.Get <Dataset>(this.subscriptionKey, GetDatasetsUrl)); }
public Synthesis GetSynthesis(Guid id) { return(VoiceAPIHelper.GetVoiceSynthesis(this.subscriptionKey, string.Format(CultureInfo.InvariantCulture, DeleteSynthesisUrl, id.ToString()))); }
public void DeleteSynthesis(Guid id) { VoiceAPIHelper.Delete(this.subscriptionKey, string.Format(CultureInfo.InvariantCulture, DeleteSynthesisUrl, id.ToString())); }
public IEnumerable <Synthesis> GetSyntheses() { return(VoiceAPIHelper.Get <Synthesis>(this.subscriptionKey, VoiceSynthesisUrl)); }
//Get Dataset public List <Dataset> GetDatasets(string SubscriptionKey) { return(VoiceAPIHelper.Get <Dataset>(SubscriptionKey, GetDatasetsUrl)); }
//Get Model public List <Model> GetModels(string SubscriptionKey) { return(VoiceAPIHelper.Get <Model>(SubscriptionKey, GetModelsUrl)); }
//Get Endpoint public List <Endpoint> GetEndpoints(string SubscriptionKey) { return(VoiceAPIHelper.Get <Endpoint>(SubscriptionKey, GetEndpointsUrl)); }
//Get VoiceTest public List <VoiceTest> GetVoiceTests(string SubscriptionKey, string modelID) { return(VoiceAPIHelper.Get <VoiceTest>(SubscriptionKey, string.Format(CultureInfo.InvariantCulture, GetVoiceTestsUrl, modelID))); }