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

Method handle

app/server/runtime.cpp:375–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373 const auto & turn = result.speaker_turns[i];
374 out << "{\"start_sample\":" << turn.span.start_sample
375 << ",\"end_sample\":" << turn.span.end_sample
376 << ",\"speaker_id\":" << json_quote(turn.speaker_id)
377 << ",\"confidence\":" << turn.confidence << "}";
378 }
379 out << "]";
380 }
381 if (!result.word_timestamps.empty()) {
382 field("words");
383 out << "[";
384 for (size_t i = 0; i < result.word_timestamps.size(); ++i) {
385 if (i != 0) {
386 out << ",";
387 }
388 const auto & word = result.word_timestamps[i];
389 out << "{\"word\":" << json_quote(word.word)
390 << ",\"start_sample\":" << word.span.start_sample
391 << ",\"end_sample\":" << word.span.end_sample
392 << ",\"confidence\":" << word.confidence << "}";
393 }
394 out << "]";
395 }
396 field("timing");
397 out << timing;
398 out << "}";
399 return out.str();
400}
401
402std::string task_result_json(const engine::runtime::TaskResult & result, double wall_ms) {
403 if (result.audio_output.has_value()) {

Callers 1

handle_clientFunction · 0.80

Calls 6

json_responseFunction · 0.85
backend_nameFunction · 0.85
error_responseFunction · 0.85
stringFunction · 0.50
to_stringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected