Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build highly expressive, context-aware audio fe...

Build highly expressive, context-aware audio features inside your app via Firebase AI Logic

Discover how to build highly expressive, context-aware audio features directly inside your client apps in a scalable, low-latency way by calling a ✨Gemini’s Text-to-Speech model via 🔥Firebase AI Logic.

Firebase Thailand

November 15, 2026

Transcript

25 slides
  1. Bangkok Build highly expressive, context-aware audio inside your app via

    Firebase AI Logic Jirawat Karanwittayakarn Firebase GDE / Tech Evangelist, LINE Thailand
  2. Firebase is Google’s app development platform Build, secure, and scale

    your backend, database, and GenAI capabilities effortlessly.
  3. Build Run App Check Cloud Functions Extensions Phone A/B Testing

    Crashlytics Performance Monitoring App Hosting Cloud Storage Cloud Firestore Realtime Database App Distribution Analytics Remote Config Auth SQL Connect Hosting Firebase AI Logic Cloud Messaging In-App Messaging Test Lab
  4. Firebase AI Logic An easy and secure way to build

    production-ready gen AI features in mobile and web apps General availability since 2024
  5. Get started at no-cost Firebase client SDKs Gemini Developer API

    Firebase AI Logic No need to deploy or manage a server/backend Agent Platform Gemini API Accelerate the time-to-market and reduce costs
  6. Firebase App Check Protect your app backends from abuse by

    preventing unauthorized clients from accessing your backend resources. Starting Nov 2, 2026, Firebase App Check enforcement will be required to use Firebase AI Logic.
  7. Gemini 3.8 Flash TTS is Google's flagship creative text-to-speech model

    Engineered for studio-grade voice fidelity, expressive acting, authentic regional accents, and stable long-form multi-turn audio.
  8. Comparison of TTS models Both Gemini 3.x TTS models have

    the same request schema and prompting format. 󰑆 Reference https://firebase.google.com/docs/ai-logic/generate-speech#supported-languages
  9. const model = getGenerativeModel(ai, { model: "gemini-3.8-flash-tts", generationConfig: { responseModalities:

    [ResponseModality.AUDIO], speechConfig: { voiceConfig: { prebuiltVoiceConfig: { voiceName: "Kore" } } } } });
  10. Core prebuilt voices Gemini TTS models support 30 core prebuilt

    voices each with distinct vocal characteristics such as “Kore”, “Puck”, “Charon”, and “Fenrir”. Reference https://firebase.google.com/docs/ai-logic/generate-speech#prebuilt-voices
  11. const prompt = [ { type: "text", text: "Have a

    wonderful day!", speechMetadata: { style: "cheerful and friendly" } } ];
  12. const result = await model.generateContent(prompt); const inlineDataParts = result.response.inlineDataParts(); if

    (inlineDataParts?.[0]) { const wavBase64 = inlineDataParts[0].inlineData.data; const wavBuffer = Uint8Array.from(atob(wavBase64), c => c.charCodeAt(0)).buffer; const audioCtx = new AudioContext(); const audioBuffer = await audioCtx.decodeAudioData(wavBuffer); const source = audioCtx.createBufferSource(); source.buffer = audioBuffer; source.connect(audioCtx.destination); source.start(); }
  13. Vocal bursts and non-speech sounds Insert non-speech human vocalizations inline

    using angle brackets (<...>) at the exact word boundary where the sound should occur. • Breathing: <breath>, <heavy breath>, <exhales>, <pant>, <sigh> • Laughter: <laugh>, <chuckle>, <giggle>, <snicker>, <cackle> • Reactions: <gasp>, <cough>, <sneeze>, <throat-clearing>, <snort> • Sounds: <sob>, <cry>, <whimper>, <groan>, <yawn> • Pauses: <short pause>, <long pause>, <tsk>, <argh> Note: If your transcript is in a non-English language, keep the inline tags (<...>) in English for best results.
  14. const model = getGenerativeModel(ai, { model: "gemini-3.8-flash-tts", generationConfig: { responseModalities:

    [ResponseModality.AUDIO], speechConfig: { voiceConfig: { prebuiltVoiceConfig: { voiceName: "Kore" } } } } });
  15. const model = getGenerativeModel(ai, { model: "gemini-3.8-flash-tts", generationConfig: { responseModalities:

    [ResponseModality.AUDIO], speechConfig: { multiSpeakerVoiceConfig: { speakerVoiceConfigs: [ { speaker: "Joe", voiceConfig: { prebuiltVoiceConfig: { voiceName: "Puck" } } }, { speaker: "Jane", voiceConfig: { prebuiltVoiceConfig: { voiceName: "Kore" } } } ] } } } });
  16. const prompt = [ { type: "text", text: "Have a

    wonderful day!", speechMetadata: { style: "cheerful and friendly" } } ];
  17. const prompt = [ { type: "text", text: "How's it

    going today, Jane?", speechMetadata: { speaker: "Joe", style: "cheerful and friendly" } }, { type: "text", text: "Not too bad, how about you?", speechMetadata: { speaker: "Jane", style: "calm and relaxed" } } ];
  18. Firebase AI Logic Key concepts 1. Serverless Client SDKs Call

    Gemini models directly from Android, iOS, and Web without building or hosting custom server backends. 2. Built-in Security & App Check Protect API keys and quotas from abuse using Firebase App Check. 3. Multimodal Inputs/Streaming/Live Support Seamlessly handle text, images, audio, and video inputs in one-time, streaming, and real-time (live) responses.

More Decks by Firebase Thailand

Other Decks in Technology