feat(19-01): implement WAV RIFF parser/writer and writeWavTags
- Add FormatWAV constant and .wav DetectFormat case - Add FormatWAV dispatch in pipeline WriteTrackTags switch - Create wav.go with custom RIFF chunk parser/writer - parseRIFF: lenient read, RF64 rejection, case-insensitive ID3 chunk detection - writeRIFF: strict write with correct padding and 4GB size check - writeWavTags: merge existing ID3v2, reuse applyTextChanges/applyCoverArtChanges - Atomic write via fileutil.AtomicWrite for crash safety
This commit is contained in:
@@ -36,6 +36,8 @@ const (
|
||||
FormatMP3 AudioFormat = "mp3"
|
||||
// FormatFLAC is the FLAC audio format.
|
||||
FormatFLAC AudioFormat = "flac"
|
||||
// FormatWAV is the WAV audio format.
|
||||
FormatWAV AudioFormat = "wav"
|
||||
)
|
||||
|
||||
// errUnsupportedFormat is returned when the audio format is not supported.
|
||||
@@ -50,6 +52,8 @@ func DetectFormat(filePath string) (AudioFormat, error) {
|
||||
return FormatMP3, nil
|
||||
case ".flac":
|
||||
return FormatFLAC, nil
|
||||
case ".wav":
|
||||
return FormatWAV, nil
|
||||
default:
|
||||
return "", fmt.Errorf("%w: %s", errUnsupportedFormat, ext)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user