Speex encoding in Java

2.6k views Asked by At

I have a .wav file and I am using JSpeex (latest version, i.e., 0.9.7) to encode it, but the encoding is not happening properly if anybody has worked on the file.

1

There are 1 answers

0
Kevin Boyd On BEST ANSWER

From here

You can find the following snippet:

When I used a different output-file format, specifically the .spx suffix, the encoding worked, and so did the subsequent decoding. The final decoded PCM WAV file then played successfully in QuickTime Player.

The original PCM WAV file I started with was "1-welcome.wav" from Sun's JavaSound demo program. If you installed Developer Tools, it's at: /Developer/Examples/Java/Sound/JavaSoundDemo/audio/

The encoding command-line:

java -cp jspeex.jar JSpeexEnc -w --verbose 1-welcome.wav welcome.spx

Because it's 11 KHz, you have to encode using '-w' (wideband), or it will fail with an obscure exception.

The decoding command-line:

java -cp jspeex.jar JSpeexDec --verbose welcome.spx welcome-pcm.wav

You can read the whole page at the link provided for more info.

Hope this solves your problem.