efssfwewe

8bitconvert.comg

Nov 17th, 2020
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash
  2. outputDir=output
  3. if [ ! -d $outputDir ]
  4. then
  5. mkdir -p $outputDir
  6. fi
  7.  
  8. #only do this if there are .WAV files vs. .wav files.
  9. count=`ls -1 *.WAV 2>/dev/null | wc -l`
  10. if [ $count != 0 ]
  11. then
  12. for infileBig in *.WAV
  13. do
  14. outfile=`basename "$infileBig" .WAV`.wav
  15. echo "Renaming $infileBig to $outifile"
  16. mv "$infileBig" "$outfile"
  17. done
  18. fi
  19.  
  20. #check for .wav and then run
  21. countwav=`ls -1 *.wav 2>/dev/null | wc -l`
  22. if [ $countwav != 0 ]
  23. then
  24. for infile in *.wav
  25. do
  26. echo "Processing "$infile
  27. sox "$infile" -r 8k -c 1 -e mu-law -b 8 "$outputDir/$infile" rate 8k
  28. done
  29. else
  30. echo "No '.wav' files available to process."
  31. fi
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment