I have a problem converting WAV
files to OGG
using oggenc
. I am always getting this exception
Warning: INVALID format chunk in wav header.
Trying to read anyway (may not work)...
ERROR: Wav file is unsupported type (must be standard PCM
or type 3 floating point PCM)
ERROR: Input file "x.wav" is not a supported format
I have installed all the dependencies like libflac
, vorbis-tools
, libvorbis
.
This problem is heppening in one of my production servers. It works fine with the same setup in local and few other systems. I have downloaded the same wav file from production and tried it in local, it works just fine.
This is the file
meta information of the wav file
>>file x.wav
x.wav: RIFF (little-endian) data, WAVE audio, stereo 48000 Hz
All my wav files are generated from mpg321
from the MP3
source. This is the entire script
for f in $(find -name "*.mp3");
do
mpg321 $f -w - | oggenc -q 5 -o "${f%.*}".ogg -;
done;
From the message i understand that either
Since the same file works without any problem in other systems, i am sure the file is a valid one. So it should be the second one.
Can someone help me out, how to check if all the dependencies for oggenc are installed correctly?
any hint would be really appreciated.
Update:
The above script doesnt generate wav files, it passes the generated wav audio stream to oggenc. To test the wav file in different systems, i have used these commands
>> mpg321 -w x.wav 0b549a8241.mp3
>> oggenc -q 5 -o x.ogg x.wav
In both methods, am getting the same error
mpg321
does not probably produce wav headers when outputs to a standard output.
As I can see, you work with 48000
stereo
.
oggenc
tool uses 44100
stereo
by default.
So -r -R 48000
must be used:
oggenc -r -R 48000 -q 5 -o x.ogg x.wav