Skip to content

Instantly share code, notes, and snippets.

@michaelforrest
Created October 10, 2021 09:37
Show Gist options
  • Save michaelforrest/c3790cb740e7c6c43f2b0e4d7ce5f78f to your computer and use it in GitHub Desktop.
Save michaelforrest/c3790cb740e7c6c43f2b0e4d7ce5f78f to your computer and use it in GitHub Desktop.
Free up space on your Zoom recorder
desc "compress it all"
task :compress do
Dir["./FOLDER01/*"].each do |dir|
Dir.chdir(dir) do
files = Dir["*.WAV"]
puts files
if Dir["processed"].empty? && Dir[".processed"].empty?
if files.include?("MASTER.WAV") || files.include?("MASTER-SOX.WAV")
puts "We got a MASTER.WAV"
else
puts "We need to make a MASTER-SOX.WAV for #{dir}"
system "sox -m #{files.join(" ")} MASTER-SOX.WAV"
end
tracks = Dir["TRACK*.WAV"]
puts "ZIPPING #{tracks.count} TRACKS in #{dir}:"
system "zip Archive.zip #{tracks.join(" ")}"
system "trash #{tracks.join(" ")}"
touch "./processed"
else
puts "already processed #{dir}"
end
end
end
end
task :default => :compress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment