views:

261

answers:

1

HI,

I am using Jspeex Api to convert a .wav file into .spx file, everything goes perfect when tested on desktop it took only 2 seconds, Android developer used the same code but they took around 3 minutes to encode the same file on their simulator & Phone. Is there any way to reduce this time for encoding? Code used to convert is as follows,
new JSpeexEnc().encode(new File("source.wav"), new File("dest.spx"));

Thanks, Rohit.

+1  A: 

Compression takes time. The better the compression, the longer it takes, and Speex is pretty good compression.

2 seconds of desktop computer time is absolutely ages.

JSpeex is a java implementation. Use a native implementation, ideally use the platform codecs, instead.

On phones, speech is best compressed using AMR - not necessarily the best quality/compression, but most likely hardware accelerated since its the format used by GSM. You can usually get AMR straight from the microphone.

How do you get large WAV files onto an Android device in the first place? If its actually the output of the microphone, consider using AMR as outlined above.

If you need Speex and you have a wav file, then consider sending it to a server for compression.

Will
The iphone doesn't support *recording* AMR out of the box (although obviously it does for the phonecalls stuff - its just not exposed to 3rd parties), but you can port an encoder. Playback works apparently. The windows and android and symbian phones all use AMR.
Will