From 48c38c8159a40664d3e0a6bad09d086df0ee7f21 Mon Sep 17 00:00:00 2001 From: nullprop Date: Wed, 18 Dec 2024 18:36:00 +0200 Subject: [PATCH] Add audio processing function --- .aliases.sh | 37 +++++++++++++++++++++++++++++++++++-- bin/unreal.sh | 2 +- install.sh | 2 ++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.aliases.sh b/.aliases.sh index 9f815ac..9962f24 100644 --- a/.aliases.sh +++ b/.aliases.sh @@ -8,7 +8,40 @@ export HISTSIZE=100 bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word -function update_system() { +function process-audio() { + if [ "$#" -ne 1 ]; then + echo "Invalid number of parameters" + echo "usage: process-audio " + return + fi + + COMPRESSED="${1%.*}-cmp.wav" + NORMALIZED="${1%.*}-norm.mp3" + + echo "" + echo "COMPRESSING" + ffmpeg -i "$1" \ + -c:a pcm_s16le \ + -af "acompressor=threshold=-24dB:attack=3:release=20:ratio=3" \ + "$COMPRESSED" + + echo "" + echo "NORMALIZING" + ffmpeg-normalize "$COMPRESSED" \ + -o "$NORMALIZED" \ + -c:a mp3 \ + -b:a 128k \ + -ar 44100 \ + -t -16 \ + -tp -2 \ + -lrt 7 \ + --dual-mono \ + -f -pr + + rm "$COMPRESSED" +} + +function update-system() { sudo pacman -Syu yay -Syu rustup update @@ -73,7 +106,7 @@ function upload_all() { done } -function randomize_filenames() { +function randomize-filenames() { for X in *; do if [ -f "$X" ]; then EXT="${X##*.}" diff --git a/bin/unreal.sh b/bin/unreal.sh index a2f2466..6d1654e 100755 --- a/bin/unreal.sh +++ b/bin/unreal.sh @@ -11,5 +11,5 @@ if [[ ${#PROJECTS[@]} -gt 0 ]]; then echo "Found project, passing to cli: '$ADDITIONAL'" fi -"$HOME/UnrealEngine/UE_5-4-2/Engine/Binaries/Linux/UnrealEditor" $ADDITIONAL +"$HOME/UnrealEngine/UE_5-5-0/Engine/Binaries/Linux/UnrealEditor" $ADDITIONAL diff --git a/install.sh b/install.sh index 045e6e5..0a37487 100755 --- a/install.sh +++ b/install.sh @@ -68,6 +68,8 @@ sudo pacman -S \ zsh \ eza +pipx install ffmpeg-normalize + # yay :) read -p "install yay? [y/N]" prompt if [[ $prompt == "y" ]]; then