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

Function step_json

tests/supertonic/supertonic_warm_bench.cpp:113–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 {"max", engine::tools::number(max_value)},
112 });
113}
114
115engine::io::json::Value step_json(
116 const engine::runtime::TaskResult & result,
117 int request_index,
118 int text_length,
119 double wall_ms,
120 const std::filesystem::path & audio_path) {
121 if (!result.audio_output.has_value()) {
122 throw std::runtime_error("Supertonic warmbench expected audio output");
123 }
124 engine::io::json::Value::Object stem{
125 {"name", engine::tools::string("audio")},
126 {"summary", audio_summary_json(*result.audio_output)},
127 };
128 if (!audio_path.empty()) {
129 stem.emplace("audio", engine::tools::string(audio_path.string()));
130 }
131 return engine::io::json::Value::make_object({
132 {"request_index", engine::tools::number(static_cast<double>(request_index))},
133 {"text_length", engine::tools::number(static_cast<double>(text_length))},
134 {"stems", engine::io::json::Value::make_array({engine::io::json::Value::make_object(std::move(stem))})},
135 {"metrics", engine::io::json::Value::make_object({{"wall_ms", engine::tools::number(wall_ms)}})},
136 });
137}
138

Callers 1

mainFunction · 0.70

Calls 4

audio_summary_jsonFunction · 0.70
stringFunction · 0.50
numberFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected