Slide 1

Slide 1 text

Bangkok Build highly expressive, context-aware audio inside your app via Firebase AI Logic Jirawat Karanwittayakarn Firebase GDE / Tech Evangelist, LINE Thailand

Slide 2

Slide 2 text

Firebase is Google’s app development platform Build, secure, and scale your backend, database, and GenAI capabilities effortlessly.

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Firebase AI Logic An easy and secure way to build production-ready gen AI features in mobile and web apps General availability since 2024

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

Illegitimate request Gemini Developer API Firebase AI Logic Legitimate request Agent Platform Gemini API

Slide 8

Slide 8 text

Auth-only Mode Only allow calls from authenticated users

Slide 9

Slide 9 text

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.

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Custom Voices Voice design Create new voice https://aistudio.google.com/generate-speech Voice replication

Slide 14

Slide 14 text

const prompt = [ { type: "text", text: "Have a wonderful day!", speechMetadata: { style: "cheerful and friendly" } } ];

Slide 15

Slide 15 text

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(); }

Slide 16

Slide 16 text

Demo

Slide 17

Slide 17 text

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: , , , , ● Laughter: , , , , ● Reactions: , , , , ● Sounds: , , , , ● Pauses: , , , Note: If your transcript is in a non-English language, keep the inline tags (<...>) in English for best results.

Slide 18

Slide 18 text

Multiple Speakers

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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" } } } ] } } } });

Slide 21

Slide 21 text

const prompt = [ { type: "text", text: "Have a wonderful day!", speechMetadata: { style: "cheerful and friendly" } } ];

Slide 22

Slide 22 text

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" } } ];

Slide 23

Slide 23 text

Demo

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

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.