DRL > Discussion
[Linux] A script to convert DoomRL music from mp3 to ogg vorbis
Cyber Killer:
There is a small problem with the HQ Linux version of DoomRL on some distros that do not support mp3 in SDL (notably Fedora and OpenSUSE). I've written a small script to take care of that problem...
Download DoomRL HQ, put this file in the same directory and run. This script doesn't delete anything, so in case you don't like it you can quite easily reverse what it does.
Requires bash, sed, find and ffmpeg with mp3 decoding and libvorbis encoding. Tested on OpenSUSE.
Note: Kornel told me he plans on switching to vorbis music in the next releases, but for now this is the easiest and fastest thing to do. The transcoding doesn't lower the music quality too much.
AStranger:
Heh, beat you to the punch: http://forum.chaosforge.org/index.php/topic,5248.msg42539/topicseen.html#msg42539. Mine requires sox and not ffmpeg and auto downloads, but basically the same idea.
Kornel Kisielewicz:
A version which would download Simon-v's native ogg versions instead of converting them from mp3's would be way cooler :>
AStranger:
Okay, this one works with 0.9.9.6, it just creates an ogg directory and converts all the mp3s that comes with DoomRL. I'll probably start working on one that actually downloads the quality oggs instead of converting, but I need some coffee first.
Spoiler (click to show/hide)
--- Code: ---#!/bin/bash
cp musichq.lua musicogg.lua
mkdir ogg
for ANMP3 in $(grep "= \"" musicogg.lua | sed -e 's/.*= \"//' -e 's/\",.*//' | awk '!x[$0]++')
do
echo "Converting: $ANMP3"
OGGNAME=$(echo $ANMP3 | sed 's/mp3/ogg/g')
sox "$ANMP3" -t vorbis "$OGGNAME"
done
sed -i 's/mp3/ogg/g' musicogg.lua
sed -i 's/dofile \"music.*lua\"/dofile \"musicogg.lua\"/' config.lua
--- End code ---
AStranger:
--- Quote from: Kornel Kisielewicz on February 28, 2012, 14:16 ---A version which would download Simon-v's native ogg versions instead of converting them from mp3's would be way cooler :>
--- End quote ---
Done and as an added bonus, I actually tested it first.
Spoiler (click to show/hide)
--- Code: ---#!/bin/bash
cp musichq.lua musicogg.lua
SIMONSITE="http://dl.dropbox.com/u/23785083/Doom_the_Roguelike_The_Album/OGG/"
SIMONV="doom_the_roguelike.ogg final_showdown.ogg hells_weapons.ogg of_skull_and_bone.ogg something_wicked.ogg the_brick_song.ogg too_hot_down_here.ogg unholy_cathedral.ogg"
MP3S=$(grep "= \"" musicogg.lua | sed -e 's/.*= \"mp3\///' -e 's/\",.*//' | awk '!x[$0]++')
CONVERTS=$(echo "$MP3S" | awk "!/$(echo $SIMONV | sed -e 's/ /|/g' -e 's/ogg/mp3/g')/")
mkdir ogg
for ANMP3 in $CONVERTS
do
echo "Converting: $ANMP3"
OGGNAME=$(echo $ANMP3 | sed 's/mp3/ogg/g')
sox "mp3/$ANMP3" -t vorbis "ogg/$OGGNAME" --show-progress
done
for ANOGG in $SIMONV
do
QUICKFIX=$(echo "$ANOGG" | sed 's/doom_the_roguelike.ogg/doom_the_roguelike_theme.ogg/')
echo "Downloading: $QUICKFIX"
wget "$SIMONSITE$QUICKFIX" -O ogg/$ANOGG
done
sed -i 's/mp3/ogg/g' musicogg.lua
sed -i 's/dofile \"music.*lua\"/dofile \"musicogg.lua\"/' config.lua
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version