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

Function step_json

tests/ace_step/ace_step_warm_bench.cpp:219–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219engine::io::json::Value step_json(
220 const engine::runtime::TaskResult & result,
221 int request_index,
222 double wall_ms,
223 const std::filesystem::path & audio_path) {
224 if (!result.audio_output.has_value()) {
225 throw std::runtime_error("ACE-Step warmbench expected audio_output");
226 }
227 engine::io::json::Value::Object stem{
228 {"name", string("mix")},
229 {"summary", audio_summary_json(*result.audio_output)},
230 };
231 if (!audio_path.empty()) {
232 stem.emplace("audio", string(audio_path.string()));
233 }
234 return engine::io::json::Value::make_object({
235 {"request_index", number(static_cast<double>(request_index))},
236 {"stems", engine::io::json::Value::make_array({engine::io::json::Value::make_object(std::move(stem))})},
237 {"metrics", engine::io::json::Value::make_object({{"wall_ms", number(wall_ms)}})},
238 });
239}
240
241} // namespace
242

Callers 1

mainFunction · 0.70

Calls 4

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

Tested by

no test coverage detected