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

Function speech_segments_to_json

app/workflow/file_sink.cpp:29–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 if (ch == '\\' || ch == '"') {
28 out.push_back('\\');
29 }
30 out.push_back(ch);
31 }
32 out.push_back('"');
33 return out;
34}
35
36std::string speech_segments_to_json(const std::vector<engine::runtime::SpeechSegment> & segments) {
37 std::ostringstream out;
38 out << "[";
39 for (size_t i = 0; i < segments.size(); ++i) {
40 if (i != 0) {
41 out << ",";
42 }
43 out << "{\"start_sample\":" << segments[i].span.start_sample
44 << ",\"end_sample\":" << segments[i].span.end_sample
45 << ",\"confidence\":" << segments[i].confidence;
46 if (!segments[i].text.empty()) {

Callers 1

emit_task_resultFunction · 0.85

Calls 2

strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected