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

Method ensure_model_loaded_locked

app/server/runtime.cpp:457–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455 out << "[REQUEST_BODY_SKIPPED] multipart_file"
456 << " field=" << json_quote(part.name)
457 << " filename=" << json_quote(part.filename)
458 << " bytes=" << part.data.size();
459 engine::debug::log_message(out.str());
460 }
461}
462
463double elapsed_ms(Clock::time_point started) {
464 return std::chrono::duration<double, std::milli>(Clock::now() - started).count();
465}
466
467double audio_duration_ms(const engine::runtime::AudioBuffer & audio) {
468 if (audio.sample_rate <= 0 || audio.channels <= 0) {
469 return 0.0;
470 }
471 return 1000.0 * static_cast<double>(audio.samples.size()) /
472 static_cast<double>(audio.sample_rate * audio.channels);
473}
474
475double audio_rtf(double wall_ms, double duration_ms) {
476 return duration_ms > 0.0 ? wall_ms / duration_ms : 0.0;
477}
478
479std::string timing_json(double wall_ms) {
480 std::ostringstream out;
481 out << "{\"wall_ms\":" << wall_ms << "}";
482 return out.str();
483}
484
485std::string timing_json(double wall_ms, const engine::runtime::AudioBuffer & audio) {
486 const double duration_ms = audio_duration_ms(audio);
487 std::ostringstream out;
488 out << "{\"wall_ms\":" << wall_ms

Callers

nothing calls this directly

Calls 4

make_default_registryFunction · 0.85
loadMethod · 0.45
create_task_sessionMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected