2008-05-03

audio-convert: Mistaking Wave Files For WMA Files

audio-convert (http://savannah.nongnu.org/projects/audio-convert) is a handy little bash script that simplifies the conversion between several audio file types, making use of various well-known codec libraries.

The only issue i faced when using the script, was that it wrongly identified my wave files as WMA files. That is because one of the checks for whether a file is of the WMA format involved looking for the word "Microsoft" in the file brief (file -b filename.wav). Somehow, my wave file has a file brief of "RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz". That coupled with the fact that i do not have mplayer installed (needed to decode WMA files) caused the script to show a warning message and exit.

A couple of simple workarounds for this:

1. If, like me, you do not work with WMA files, you can just comment out the part of the script that checks whether mplayer is installed (lines 1270 to 1281).

2. A better way would be to modify the WMA file detection in line 455 to just check if the filename ends in ".wma" (case-insensitive). Then, when you do have to work with an input WMA file, just ensure that it has a WMA file extension.

This issue, as well as both workarounds, have been filed as bug #23141 (http://savannah.nongnu.org/bugs/index.php?23141).