fix: delete non .wav file after conversion.

This commit is contained in:
Chigozirim Igweamaka 2025-07-09 12:30:31 +01:00
parent e51b06c159
commit 29867c8b34

View file

@ -21,6 +21,10 @@ func ConvertToWAV(inputFilePath string, channels int) (wavFilePath string, err e
}
fileExt := filepath.Ext(inputFilePath)
if fileExt != ".wav" {
defer os.Remove(inputFilePath)
}
outputFile := strings.TrimSuffix(inputFilePath, fileExt) + ".wav"
// Output file may already exists. If it does FFmpeg will fail as