| 122 | } |
| 123 | |
| 124 | inline io::json::Value speech_segments_json(const std::vector<runtime::SpeechSegment> & segments) { |
| 125 | io::json::Value::Array out; |
| 126 | out.reserve(segments.size()); |
| 127 | for (const auto & segment : segments) { |
| 128 | out.push_back(io::json::Value::make_object({ |
| 129 | {"start_sample", number(static_cast<double>(segment.span.start_sample))}, |
| 130 | {"end_sample", number(static_cast<double>(segment.span.end_sample))}, |
| 131 | {"confidence", number(segment.confidence)}, |
| 132 | })); |
| 133 | } |
| 134 | return io::json::Value::make_array(std::move(out)); |
| 135 | } |
| 136 | |
| 137 | inline io::json::Value speaker_turns_json(const std::vector<runtime::SpeakerTurn> & turns) { |
| 138 | io::json::Value::Array out; |
no test coverage detected