SpeechConfig
public struct SpeechConfig : SendableSpeech configuration class for controlling the model's speech and audio generation behaviors.
This allows you to configure the voice properties (single-speaker OR multi-speaker setup) and language preferences when requesting the model to generate spoken responses.
-
Creates a new
SpeechConfigvalue for a single voice.Declaration
Swift
public init(voiceName: String, languageCode: String? = nil)Parameters
voiceNameThe name of the prebuilt voice to be used for the model's speech response.
languageCodeBCP-47 language code to use when parsing text sent from the client, instead of audio. By default, the model will attempt to detect the input language automatically.
-
Creates a new
SpeechConfigvalue for a multi-speaker setup.Warning
Multi-speaker configurations are not currently supported by the Live API (e.g.,
LiveGenerationConfig).Declaration
Swift
public init(multiSpeakerVoiceConfig: MultiSpeakerVoiceConfig, languageCode: String? = nil)Parameters
multiSpeakerVoiceConfigThe configuration detailing multiple speakers and their corresponding voices.
languageCodeBCP-47 language code to use when parsing text sent from the client.