{"id":464,"date":"2025-02-14T04:46:09","date_gmt":"2025-02-14T04:46:09","guid":{"rendered":"https:\/\/metajack.org\/blog\/?p=464"},"modified":"2025-02-14T04:46:09","modified_gmt":"2025-02-14T04:46:09","slug":"removing-silent-wav-files","status":"publish","type":"post","link":"http:\/\/metajack.org\/blog\/2025\/02\/14\/removing-silent-wav-files\/","title":{"rendered":"Removing silent wav files"},"content":{"rendered":"\n<p>I use the following script to copy files from my 16 track stems. The script copies the files over, then uses sox to find &#8220;silent&#8221; files and remove them. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#\n# February 12, 2025 (Wednesday)\n#\n\necho \"Copying files to ~\/Music\/incoming_mixer_files\/\"\n#rsync -va \/Volumes\/NO\\ NAME\/Records ~\/Music\/incoming_mixer_files\/\nEXIT_STATUS=$?\n\n# Check if rsync was successful\nif &#91; $EXIT_STATUS -ne 0 ]; then\n    echo \"Error: rsync failed with status $EXIT_STATUS\"\n    exit $EXIT_STATUS\nelse\n    echo \"Files copied successfully to ~\/Music\/incoming_mixer_files\/.\"\nfi\n\n\nfind ~\/Music\/incoming_mixer_files\/ -type f -name \"*.wav\" -exec sh -c '\n    for file; do\n#        echo \"Processing: $file\"\n        \n        # Get RMS level in dB directly\n        rms_db=$(sox \"$file\" -n stats 2>&amp;1 | awk \"\/RMS lev dB\/ {print \\$4}\")\n        \n        # Check if below threshold (-65dB) - comparing as a number\n        if &#91; -n \"$rms_db\" ] &amp;&amp; &#91; $(echo \"$rms_db &lt; -65\" | bc) -eq 1 ]; then\n            #echo \"SILENT FILE DETECTED: $file (${rms_db}dB)\"           \n            mv \"$file\" ~\/.Trash\/\n        else\n            echo \"Active file - keeping: $file (${rms_db}dB)\"\n        fi\n    done\n' sh {} +\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I use the following script to copy files from my 16 track stems. The script copies the files over, then uses sox to find &#8220;silent&#8221; files and remove them.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-464","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/comments?post=464"}],"version-history":[{"count":1,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/464\/revisions"}],"predecessor-version":[{"id":465,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/464\/revisions\/465"}],"wp:attachment":[{"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/media?parent=464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/categories?post=464"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/tags?post=464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}