Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active November 10, 2024 12:06
Show Gist options
  • Save shmerl/2cec6273ba25dd1486dd to your computer and use it in GitHub Desktop.
Save shmerl/2cec6273ba25dd1486dd to your computer and use it in GitHub Desktop.
#!/bin/bash
# Run from location where you have audio
# from the <game-dir>/streammusic directory
mp3s=(
[0-5]*.wav
mus_{a,b,t}*.wav
evil_ending.wav
credits.wav
)
wavs=(
al_*.wav
mus_loadscreen.wav
)
mkdir -p fixed
for src in ${mp3s[@]}; do
target="fixed/${src%%.*}.mp3"
echo "fixing ${src} -> ${target}"
dd if=${src} of=${target} ibs=1 skip=58 obs=10M
done
for src in ${wavs[@]}; do
target="fixed/${src}"
echo "fixing ${src} -> ${target}"
dd if=${src} of=${target} ibs=1 skip=470 obs=10M
done
@shmerl
Copy link
Author

shmerl commented Nov 10, 2024

Nice, that would be useful for those who don't have bash on Windows set up.

@geextahslex
Copy link

Indeed, I was confronted yesterday with this problem. You can take this code and put it somewhere for future kotor fans. I don't know github so well. Or just leave it as a coment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment