MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / handle_speech

Method handle_speech

app/server/runtime.cpp:597–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595
596void ServerState::load_voice_presets(LoadedModel & model) const {
597 for (const auto & [name, preset] : model.config.voice_presets) {
598 auto [it, inserted] = model.voice_presets.emplace(name, load_runtime_voice_preset(preset));
599 if (!inserted) {
600 throw std::runtime_error("duplicate runtime voice preset for model " + model.config.id + ": " + name);
601 }
602 (void) it;
603 }
604 if (model.config.default_voice_preset_id.has_value()) {
605 const auto it = model.voice_presets.find(*model.config.default_voice_preset_id);
606 if (it == model.voice_presets.end()) {
607 throw std::runtime_error(
608 "default_voice_preset for model " + model.config.id +
609 " was not loaded: " +
610 *model.config.default_voice_preset_id);
611 }
612 model.default_voice_preset = it->second;
613 } else if (model.config.default_voice_preset.has_value()) {
614 model.default_voice_preset = load_runtime_voice_preset(*model.config.default_voice_preset);
615 }
616}
617
618void ServerState::ensure_model_loaded_locked(LoadedModel & model) {
619 if (model.session != nullptr) {

Callers

nothing calls this directly

Calls 11

parseFunction · 0.85
encode_pcm16_wavFunction · 0.85
json_responseFunction · 0.85
base64_encodeFunction · 0.85
timing_jsonFunction · 0.85
timing_headersFunction · 0.85
json_quoteFunction · 0.70
optional_stringFunction · 0.50
stringFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected