Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Accepts a single argument, which is a path to the directory containing all the
  4. # WAV files generated by a recordings from the X-Live card.
  5. # Looks for files like 000000.WAV 000001.WAV 000002.WAV etc.
  6. #
  7. # Outputs files like Ch01.WAV Ch02.WAV Ch03.WAV etc.
  8. #
  9. # Requires sox
  10.  
  11.  
  12. cd "$1"
  13.  
  14. shopt -s nullglob # Empty array when no matching files
  15. wavFiles=(*.WAV)
  16.  
  17. echo ${#wavFiles[@]}
  18.  
  19. if [ ${#wavFiles[@]} -eq 0 ]; then
  20. echo "No WAV files found in `pwd`"
  21. exit
  22. fi
  23.  
  24. echo "Found these wav files: ${wavFiles[@]}"
  25.  
  26. for run in {01..32}; do
  27. echo "Splitting out channel ${run}"
  28. channel=$(printf "%02d" $run)
  29.  
  30. `sox ${wavFiles[@]} Ch${channel}.wav remix ${run}`
  31. done
  32.  
  33. echo "Done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement