SkillsGrove
SkillsGrove/생산성/JAICHANGPARK/flutter_gemini_live/gemini-live-translate

gemini-live-translate

설치

$npx skills add https://github.com/JAICHANGPARK/flutter_gemini_live --skill gemini-live-translate
$git clone --depth 1 https://github.com/JAICHANGPARK/flutter_gemini_live.git /tmp/flutter_gemini_live && mkdir -p ~/.claude/skills && cp -r /tmp/flutter_gemini_live/.hermes/skills/gemini-live-translate ~/.claude/skills/gemini-live-translate
이 Agent Skill을 설치해 주세요: https://github.com/JAICHANGPARK/flutter_gemini_live/tree/8e51a205f69168cc37834c8b0193c83a9f270f5c/.hermes/skills/gemini-live-translate — 먼저 SKILL.md와 스크립트를 읽고, 안전하다고 확인한 뒤에만 제 skills 폴더에 설치해 주세요.

요약

원문 설명 · BSD-3-ClauseImplement real-time, bidirectional speech-to-speech translation in Flutter using the Gemini Live Translate model. Use when connecting to gemini-3.5-live-translate-preview, configuring TranslationConfig (targetLanguageCode, echoTargetLanguage), or building dual-sided/split-screen interpreter UI applications.
아래 SKILL.md는 JAICHANGPARK/flutter_gemini_live(커밋 8e51a20)에서 BSD-3-Clause 라이선스에 따라 게시한 것입니다. 본문은 변경하지 않았으며, 파일 상단의 메타데이터만 생략하고 이미지는 링크로 표시하며 매우 긴 파일은 일부만 표시합니다. Copyright 2025, Dreamwalker. 라이선스: LICENSE. 지침 파일만 표시되며 스크립트 등은 원본 저장소를 참고하세요.

Gemini Live Speech-to-Speech Translation Skill

This skill provides instructions for building real-time, low-latency live speech translation applications using Google's dedicated Live Translate model (gemini-3.5-live-translate-preview).


🌐 Model & Translation Configuration

The Live translation model operates as a streaming audio-in, audio-out interpreter:

Parameter Recommended Value Notes
Model ID gemini-3.5-live-translate-preview (LiveModels.gemini35LiveTranslatePreview) Dedicated streaming translation model.
targetLanguageCode BCP-47 tag (e.g., 'es', 'ja', 'ko', 'fr') Language to translate the speaker's voice into.
echoTargetLanguage false (default) If true, repeats the spoken target text before playing translation.
Response Modalities [Modality.AUDIO] Audio output containing the translated voice.

🚀 Setting Up Live Translation Session

import 'package:flutter/material.dart';
import 'package:gemini_live/gemini_live.dart';

Future<void> connectTranslator({
  required GeminiLiveSessionController controller,
  required String targetLanguage, // e.g. 'es' (Spanish), 'ko' (Korean)
  GeminiLiveVoice voice = GeminiLiveVoice.puck,
}) async {
  await controller.connect(
    LiveConnectParameters(
      model: LiveModels.gemini35LiveTranslatePreview,
      config: GenerationConfig(
        responseModalities: [Modality.AUDIO],
        speechConfig: SpeechConfig.fromLiveVoice(voice),
        // Live speech-to-speech translation settings
        translationConfig: TranslationConfig(
          targetLanguageCode: targetLanguage,
          echoTargetLanguage: false,
        ),
      ),
      // Transcribe both user speech and translated model speech
      inputAudioTranscription: AudioTranscriptionConfig(),
      outputAudioTranscription: AudioTranscriptionConfig(),
      callbacks: LiveCallbacks(
        onError: (e, st) => debugPrint('Translation Error: $e'),
      ),
    ),
  );
}

📱 Face-to-Face Dual-Sided UI Pattern

For in-person conversations where two people sit across from each other, render a split screen where the top half is flipped 180 degrees for the counterparty:

Widget buildSplitScreenInterpreter(BuildContext context, GeminiLiveSessionController controller) {
  return Column(
    children: [
      // 1. Counterparty Screen (Rotated 180 degrees)
      Expanded(
        child: RotatedBox(
          quarterTurns: 2, // 180 degree flip for person sitting opposite
          child: Container(
            color: Colors.blueGrey.shade900,
            padding: const EdgeInsets.all(20),
            child: Center(
              child: Text(
                controller.lastModelText ?? 'Listening for counterparty...',
                style: const TextStyle(fontSize: 22, color: Colors.white),
                textAlign: TextAlign.center,
              ),
            ),
          ),
        ),
      ),

      const Divider(height: 2, thickness: 2, color: Colors.amber),

      // 2. User Screen (Normal Orientation)
      Expanded(
        child: Container(
          color: Colors.grey.shade900,
          padding: const EdgeInsets.all(20),
          child: Center(
            child: Text(
              controller.lastUserText ?? 'Speak to translate...',
              style: const TextStyle(fontSize: 22, color: Colors.white),
              textAlign: TextAlign.center,
            ),
          ),
        ),
      ),
    ],
  );
}

🚨 Critical Translation Rules

  1. Always use the dedicated Translate model: Do not use standard gemini-3.8-live with a translation prompt if gemini-3.5-live-translate-preview is available. The dedicated translate model has specialized low-latency streaming pipeline optimizations.
  2. Handle target language switches dynamically: When users switch conversational directions (e.g. English -> Korean to Korean -> English), reconnect with the updated targetLanguageCode.
라이선스 전문 보기(BSD-3-Clause)
BSD 3-Clause License

Copyright (c) 2025, Dreamwalker

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.