Accept selected audio formats in transcription
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user