src/google: GoogleClient over molo::clients (key in x-goog-api-key, never in
URLs), Service base, TextToSpeech, SpeechToText, Generative (replies, audio
in, audio out), Recognizer/Synthesizer seams with cloud, gemini and vertex
backends, VoicePipeline with bounded history. Example: /voice live
conversation page, /voice/{say,hear,turn,reset}, /google/status. Keys load
from env, .env.json.local, .env.json. Paid routes are excluded from locust.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
18 lines
503 B
C++
18 lines
503 B
C++
#pragma once
|
|
|
|
// Gemini TTS returns raw 16-bit PCM; browsers need a container.
|
|
|
|
#include <string>
|
|
|
|
namespace molo::google {
|
|
|
|
// Wraps little-endian mono/stereo 16-bit PCM in a RIFF/WAVE header.
|
|
std::string pcm16_to_wav(const std::string& pcm, int sample_rate_hz,
|
|
int channels = 1);
|
|
|
|
// Sample rate from a mime like "audio/L16;codec=pcm;rate=24000"; fallback
|
|
// when absent.
|
|
int sample_rate_from_mime(const std::string& mime, int fallback = 24000);
|
|
|
|
} // namespace molo::google
|