Skip to content

Instantly share code, notes, and snippets.

@FreeApp2014
Created May 3, 2020 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FreeApp2014/338197edf804ea92dd162b72b777d1be to your computer and use it in GitHub Desktop.
Save FreeApp2014/338197edf804ea92dd162b72b777d1be to your computer and use it in GitHub Desktop.
Resample brstm files using revolution (via ffmpeg)
newSR=48000 # The new sample rate
currentSR=$(./brstm_converter "$1" | grep "Sample rate" | grep -o -E [0-9]+);
currentLoop=$(./brstm_converter "$1" | grep "Loop start" | grep -o -E [0-9]+);
newLoopPoint=$(echo "scale=3;$currentLoop*($newSR/$currentSR)" | bc);
./brstm_converter "$1" -l $newLoopPoint --ffmpeg "-ar $newSR" -o "$1.new.brstm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment