tags:

views:

350

answers:

2

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.

+2  A: 

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.

Kevin Boyd
can i do it through code not from command line
Sam97305421562
it is working perfectly fine . Thanks
Sam97305421562
A: 

how to do this by java code anyone

evan
To do it in "code" you will need to look at the source for JSpeexDec and JSpeexEnc. From that source you would be able to figure it out.
Mondain