Some checks failed
CodeQL / Analyze (go) (push) Successful in 6m28s
Docker Image / build-docker (push) Failing after 13m26s
Lint and Testing / lint (push) Successful in 11m17s
Lint and Testing / test (push) Successful in 11m17s
Lint and Testing / golangci (push) Successful in 2m40s
27 lines
615 B
Go
27 lines
615 B
Go
package config
|
|
|
|
import (
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
// Transcript controls how STT segments are joined into one text field (with embedded newlines).
|
|
type Transcript struct {
|
|
PauseGapSec float64 `yaml:"pause_gap_sec"`
|
|
SpeakerLabel string `yaml:"speaker_label"`
|
|
}
|
|
|
|
func (t Transcript) WithDefaults() Transcript {
|
|
if t.PauseGapSec <= 0 {
|
|
t.PauseGapSec = 1.5
|
|
}
|
|
if strings.TrimSpace(t.SpeakerLabel) == "" {
|
|
t.SpeakerLabel = "Спикер"
|
|
}
|
|
return t
|
|
}
|
|
|
|
func (t Transcript) PauseGapDuration() time.Duration {
|
|
return time.Duration(t.PauseGapSec * float64(time.Second))
|
|
}
|