Google/GoogleSpeech.php

synaplan · backend/src/AI/Provider/Google/GoogleSpeech.php · php · Apache-2.0
voice

GoogleSpeech.php from metadist/synaplan

// Source: https://github.com/metadist/synaplan | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace App\AI\Provider\Google;

use App\AI\Exception\ProviderException;
use App\Service\File\FileHelper;
use Psr\Log\LoggerInterface;

/**
 * Gemini speech for GoogleProvider: transcription with Gemini Transcribe
 * (the duration from the audio token count, else from a WAV header) and
 * speech synthesis with the Gemini TTS models, raw PCM wrapped into a WAV
 * container and stored in the upload directory.
 */
final class GoogleSpeech
{
    /**
     * Gemini Transcribe bills audio at 25 tokens/sec; used to recover duration
     * from usageMetadata when the response has no clo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key