Closed qadirsuh closed 3 years ago
i believe you found a bug :) pull and try again, let me know if it works!
Updated and now got a new error,
sox FAIL formats: can't open input file
/tmp/noiseclean_tmpaud.wav': WAVE: RIFF header not found
`
Here is complete log
Qadir-Hussain-mac:noiseclean qadirhussain$ sh noiseclean.sh mpthreetest.mp3 mpthreetest_clean.mp3 [mp3 @ 0x7f825f002600] Estimating duration from bitrate, this may be inaccurate Detected 'mpthreetest.mp3' as an audio file Sample noise start time [00:00:00]: Sample noise end time [00:00:00.500]: Noise reduction amount [0.21]: Cleaning noise on 'mpthreetest.mp3'... [mp3 @ 0x7f95f7800000] Estimating duration from bitrate, this may be inaccurate sox FAIL formats: can't open input file
/tmp/noiseclean_tmpaud.wav': WAVE: RIFF header not found
cp: /tmp/noiseclean_tmpaud-clean.wav: No such file or directory
Done
`
Could you attach the mp3 file? I'll try to make it work
Does this work at your side. I have tried with wav file and mp3 files found randomly from google. Same issue appears at my side
It doesn't work as sox doesn't support .mp3 format 'out of box' (SoX v14.4.1 in Ubuntu 16.04) or it doesn't recognizes mp3 when it has the '.wav' extension. Instead of copying to the tmp directory, renaming mp3 to wav and back, the script could do ffmpeg conversion like this:
diff --git a/noiseclean.sh b/noiseclean.sh
index 8ff789a..18ecd46 100755
--- a/noiseclean.sh
+++ b/noiseclean.sh
@@ -63,7 +63,7 @@ if [ $isVideo -eq "1" ]; then
ffmpeg -v warning -y -i "$1" -qscale:v 0 -vcodec copy -an "$tmpVidFile"
ffmpeg -v warning -y -i "$1" -qscale:a 0 "$tmpAudFile"
else
- cp "$1" "$tmpAudFile"
+ ffmpeg -y -i "$1" "$tmpAudFile"
fi
ffmpeg -v warning -y -i "$1" -vn -ss "$sampleStart" -t "$sampleEnd" "$noiseAudFile"
sox "$noiseAudFile" -n noiseprof "$noiseProfFile"
@@ -71,7 +71,8 @@ sox "$tmpAudFile" "$tmpAudCleanFile" noisered "$noiseProfFile" "$sensitivity"
if [ $isVideo -eq "1" ]; then
ffmpeg -v warning -y -i "$tmpAudCleanFile" -i "$tmpVidFile" -vcodec copy -qscale:v 0 -qscale:a 0 "$2"
else
- cp "$tmpAudCleanFile" "$2"
+ ffmpeg -y -i "$tmpAudCleanFile" "$2"
fi
echo "Done"
+
Thanks for your reply on issue #2
I installed the below
I tried again. see the log below
I am getting this error now
sox FAIL formats: can't open input file
/tmp/noiseclean_tmpaud.wav': No such file or directory` here is screenshot of my /tmp dir https://www.dropbox.com/s/g86iqx0cooojs2s/Screenshot%202017-05-03%2010.56.29.png?dl=0 Whats wrong in this now?