Updating
This commit is contained in:
-6
@@ -8,7 +8,6 @@ namespace LCU.Webapps.Marketing.SPIT.Model
|
||||
public string AppName { get; set; }
|
||||
public string SeqApiKey { get; set; }
|
||||
public string SeqUrl { get; set; }
|
||||
public string SubscriptionKey { get; set; }
|
||||
public string SpeechApiKey { get; set; }
|
||||
public string SpeechEndpoint { get; set; }
|
||||
public string FetchTokenUri { get; set; }
|
||||
@@ -21,11 +20,6 @@ namespace LCU.Webapps.Marketing.SPIT.Model
|
||||
public string DefaultLanguageWithCountryCode { get; set; }
|
||||
public List<string> EnabledLanguageOptionCodes { get; set; }
|
||||
|
||||
public string ResolveSpeechSubscriptionKey()
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(SpeechApiKey) ? SubscriptionKey : SpeechApiKey;
|
||||
}
|
||||
|
||||
public bool HasSpeechEndpoint()
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(SpeechEndpoint);
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@
|
||||
|
||||
await JSRuntime.InvokeVoidAsync(
|
||||
"synthesizeSpeech",
|
||||
spitConfiguration.ResolveSpeechSubscriptionKey(),
|
||||
spitConfiguration.SpeechApiKey,
|
||||
spitConfiguration.Region,
|
||||
spitConfiguration.SpeechEndpoint,
|
||||
_textToSpeech.Ssml);
|
||||
|
||||
+2
-7
@@ -20,7 +20,7 @@ public class AuthenticationService
|
||||
var uri = BuildTokenUri();
|
||||
|
||||
var client = _lcuHttpClient.CreateClient(uri);
|
||||
client.DefaultRequestHeaders.Add(_spitConfiguration.OcpApimSubscriptionKey, _spitConfiguration.ResolveSpeechSubscriptionKey());
|
||||
client.DefaultRequestHeaders.Add(_spitConfiguration.OcpApimSubscriptionKey, _spitConfiguration.SpeechApiKey);
|
||||
|
||||
var result = await client.PostAsync(uri.AbsoluteUri, null);
|
||||
return await result.Content.ReadAsStringAsync();
|
||||
@@ -28,11 +28,6 @@ public class AuthenticationService
|
||||
|
||||
private Uri BuildTokenUri()
|
||||
{
|
||||
if (_spitConfiguration.HasSpeechEndpoint())
|
||||
{
|
||||
return new Uri(_spitConfiguration.ResolveSpeechEndpointUri(), "/sts/v1.0/issueToken");
|
||||
}
|
||||
|
||||
return new Uri($"https://{_spitConfiguration.Region}.{_spitConfiguration.FetchTokenUri}");
|
||||
return new Uri(_spitConfiguration.ResolveSpeechEndpointUri(), "/sts/v1.0/issueToken");
|
||||
}
|
||||
}
|
||||
|
||||
+3
-8
@@ -107,14 +107,9 @@ namespace LCU.Webapps.Marketing.SPIT.Services
|
||||
|
||||
private SpeechConfig BuildSpeechConfig()
|
||||
{
|
||||
var subscriptionKey = _spitConfiguration.ResolveSpeechSubscriptionKey();
|
||||
|
||||
if (_spitConfiguration.HasSpeechEndpoint())
|
||||
{
|
||||
return SpeechConfig.FromEndpoint(_spitConfiguration.ResolveSpeechEndpointUri(), subscriptionKey);
|
||||
}
|
||||
|
||||
return SpeechConfig.FromSubscription(subscriptionKey, _spitConfiguration.Region);
|
||||
return SpeechConfig.FromEndpoint(
|
||||
_spitConfiguration.ResolveSpeechEndpointUri(),
|
||||
_spitConfiguration.SpeechApiKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -50,12 +50,7 @@ namespace LCU.Webapps.Marketing.SPIT.Services
|
||||
|
||||
private Uri BuildVoicesUri()
|
||||
{
|
||||
if (_spitConfiguration.HasSpeechEndpoint())
|
||||
{
|
||||
return new Uri(_spitConfiguration.ResolveSpeechEndpointUri(), "/cognitiveservices/voices/list");
|
||||
}
|
||||
|
||||
return new Uri($"https://{_spitConfiguration.Region}{_spitConfiguration.VoicesUrl}");
|
||||
return new Uri(_spitConfiguration.ResolveSpeechEndpointUri(), "/cognitiveservices/voices/list");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@
|
||||
"AppName": "Speech Production Interface Tool",
|
||||
"SeqApiKey": "VALUE-IN-KEYVAULT",
|
||||
"SeqUrl": "https://qa-seq.lcu-internal.com",
|
||||
"SubscriptionKey": "VALUE-IN-KEYVAULT",
|
||||
"SpeechApiKey": "VALUE-IN-KEYVAULT",
|
||||
"SpeechEndpoint": "VALUE-IN-KEYVAULT",
|
||||
"FetchTokenUri": "api.cognitive.microsoft.com/sts/v1.0/issueToken",
|
||||
|
||||
Reference in New Issue
Block a user