Skip to content

Instantly share code, notes, and snippets.

@azarbayejani
Created July 9, 2025 23:59
Show Gist options
  • Select an option

  • Save azarbayejani/40be9d307efb83545f52decaa6945730 to your computer and use it in GitHub Desktop.

Select an option

Save azarbayejani/40be9d307efb83545f52decaa6945730 to your computer and use it in GitHub Desktop.
Scripts for DJs
#!/bin/bash
###############################################################
# Script Name: convert-to-320-mp3.sh
# Description: Converts audio files to mp3
# Author: @miseryconfusion.com
# Date: 2025-07-09
# Version: 1.0
# Usage: ./convert-to-mp3.sh file-to-convert ...
# Notes: This script requires ffmpeg to run
###############################################################
for f in "$@"
do
file=$f
newfile=${file%.*}
ffmpeg -i "$f" -b:a 320k "$newfile".mp3
done
#!/bin/bash
###############################################################
# Script Name: convert-to-aiff.sh
# Description: Converts audio files to aiff
# Author: @miseryconfusion.com
# Date: 2025-07-09
# Version: 1.0
# Usage: ./convert-to-aiff.sh file-to-convert ...
# Notes: This script requires ffmpeg to run
###############################################################
for f in "$@"
do
file=$f
newfile=${file%.*}
ffmpeg -i "$f" -write_id3v2 1 "$newfile".aif
done
#!/bin/bash
################################################################
# Script Name: get-spectrogram.sh
# Description: Generates a spectrogram and opens it
# Author: @miseryconfusion.com
# Date: 2025-07-09
# Version: 1.0
# Usage: ./convert-to-aiff.sh file-to-convert ...
# Notes: This script requires sox to run. Also, `open` may
not be available on your system.
################################################################
sox "$1" -n spectrogram -o /tmp/spectrogram.png
# open /tmp/spectrogram.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment