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

Function validate_options

src/framework/text/subtitle.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace {
11
12void validate_options(const SubtitleFormatOptions & options) {
13 if (options.sample_rate <= 0) {
14 throw std::runtime_error("subtitle formatter requires a positive sample_rate");
15 }
16 if (options.max_chars_per_line <= 0) {
17 throw std::runtime_error("subtitle formatter requires max_chars_per_line > 0");
18 }
19 if (options.max_lines <= 0) {
20 throw std::runtime_error("subtitle formatter requires max_lines > 0");
21 }
22 if (!(options.max_block_seconds > 0.0)) {
23 throw std::runtime_error("subtitle formatter requires max_block_seconds > 0");
24 }
25 if (options.max_gap_seconds < 0.0) {
26 throw std::runtime_error("subtitle formatter requires max_gap_seconds >= 0");
27 }
28}
29
30void validate_word(const runtime::WordTimestamp & word, int64_t previous_start) {
31 if (word.word.empty()) {

Callers 1

build_subtitle_blocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected