| 111 | {"max", engine::tools::number(max_value)}, |
| 112 | }); |
| 113 | } |
| 114 | |
| 115 | engine::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 |
no test coverage detected