When enabling ultra realistic voices, if granted select a default voice

This commit is contained in:
Jackson Harper 2022-11-11 11:06:56 +08:00
parent 1613af79a6
commit 98df7164e5
2 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,12 @@ import Views
audioController.useUltraRealisticVoices = true
audioController.ultraRealisticFeatureRequested = true
audioController.ultraRealisticFeatureKey = feature.granted ? feature.token : ""
if feature.granted, !Voices.isUltraRealisticVoice(audioController.currentVoice) {
// Attempt to set to an ultra voice
if let voice = Voices.UltraPairs.first {
audioController.currentVoice = voice.firstKey
}
}
self.realisticVoicesToggle = true
} else {
audioController.useUltraRealisticVoices = false

View file

@ -36,10 +36,10 @@ public enum VoiceCategory: String, CaseIterable {
}
public struct VoicePair {
let firstKey: String
public let firstKey: String
let secondKey: String
let firstName: String
public let firstName: String
let secondName: String
let language: String