Skip to content

Gemini multi-speaker audio support reintroduction#543

Open
allurco wants to merge 1 commit into
laravel:0.xfrom
allurco:feature/gemini-multispeaker
Open

Gemini multi-speaker audio support reintroduction#543
allurco wants to merge 1 commit into
laravel:0.xfrom
allurco:feature/gemini-multispeaker

Conversation

@allurco

@allurco allurco commented May 8, 2026

Copy link
Copy Markdown
Contributor

Adds array $providerOptions to the AudioGateway contract and a matching fluent setter on PendingAudioGeneration. GeminiGateway uses providerOptions['speakers'] to emit multiSpeakerVoiceConfig instead of the single-voice voiceConfig, with the same default-female/default-male aliases and up-front validation. Other audio gateways accept the parameter for interface conformance and ignore it.

Example — a two-host podcast intro:

Audio::of("Host: Welcome to Laravel Weekly.\nGuest: Glad to be here!")
    ->providerOptions([
        'speakers' => [
            ['name' => 'Host',  'voice' => 'Kore'],
            ['name' => 'Guest', 'voice' => 'Puck'],
        ],
    ])
    ->generate(provider: 'gemini', model: 'gemini-2.5-flash-preview-tts');

Adds `array $providerOptions` to the AudioGateway contract and a
matching fluent setter on PendingAudioGeneration. GeminiGateway uses
`providerOptions['speakers']` to emit `multiSpeakerVoiceConfig`
instead of the single-voice `voiceConfig`, with the same
`default-female`/`default-male` aliases and up-front validation.
Other audio gateways accept the parameter for interface conformance
and ignore it.

Example — a two-host podcast intro:

    Audio::of("Host: Welcome to Laravel Weekly.\nGuest: Glad to be here!")
        ->providerOptions([
            'speakers' => [
                ['name' => 'Host',  'voice' => 'Kore'],
                ['name' => 'Guest', 'voice' => 'Puck'],
            ],
        ])
        ->generate(provider: 'gemini', model: 'gemini-2.5-flash-preview-tts');
@allurco allurco marked this pull request as draft May 8, 2026 16:35
@allurco allurco marked this pull request as ready for review May 8, 2026 16:35
@allurco allurco changed the title [WIP] Add Gemini multi-speaker audio support Add Gemini multi-speaker audio support May 8, 2026
@allurco allurco changed the title Add Gemini multi-speaker audio support Gemini multi-speaker audio support reintroduction May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant