Accept selected audio formats in transcription

This commit is contained in:
2026-12-02 03:18:02 +00:00
parent 35ddc5ed96
commit 3b16bf2790
4 changed files with 61 additions and 11 deletions

View File

@@ -206,7 +206,7 @@ func discoverPreparedAudio(m *manifest.Manifest, paths artifacts.SessionPaths) (
}
p := strings.TrimSpace(in.Path)
if p == "" {
continue
return nil, fmt.Errorf("audio path is required")
}
fromManifest = append(fromManifest, artifacts.ResolveSessionLocalPathForRead(paths, p))
}
@@ -230,7 +230,7 @@ func discoverPreparedAudio(m *manifest.Manifest, paths artifacts.SessionPaths) (
continue
}
p := filepath.Join(paths.AudioDir, entry.Name())
if !isFlac(p) {
if !audio.IsCandidate(p) {
continue
}
out = append(out, p)
@@ -248,13 +248,11 @@ func validateAudioFiles(paths []string) error {
}
seen := map[string]struct{}{}
for _, p := range paths {
clean := filepath.Clean(strings.TrimSpace(p))
if clean == "" {
trimmed := strings.TrimSpace(p)
if trimmed == "" {
return fmt.Errorf("audio path is required")
}
if !isFlac(clean) {
return fmt.Errorf("audio file %q must have .flac extension", clean)
}
clean := filepath.Clean(trimmed)
info, err := os.Stat(clean)
if err != nil {
return fmt.Errorf("audio file %q not found: %w", clean, err)