go-whisper-api/config/transcript.go
admin b5c083e06f
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
first commit
2026-06-04 18:10:52 +07:00

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))
}