FirebaseAILogic Framework Reference

SpeechConfig

public struct SpeechConfig : Sendable

Speech 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 SpeechConfig value for a single voice.

    Declaration

    Swift

    public init(voiceName: String, languageCode: String? = nil)

    Parameters

    voiceName

    The name of the prebuilt voice to be used for the model's speech response.

    languageCode

    BCP-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 SpeechConfig value 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

    multiSpeakerVoiceConfig

    The configuration detailing multiple speakers and their corresponding voices.

    languageCode

    BCP-47 language code to use when parsing text sent from the client.