WAV to Speex conversion takes a long time

I am using the JSpeex API to convert a WAV file to a .spx file. Everything works great when tested on the desktop; it only took 2 seconds.

Android developer used the same code, but it took about 3 minutes to encode the same file on their simulator and phone. Is there a way to shorten this coding time? The code used for the conversion looks like this:

new JSpeexEnc().encode(new File("source.wav"), new File("dest.spx"));

      

+2


source to share


1 answer


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

2 seconds of desktop time is absolutely age.

JSpeex is a Java implementation. Use built-in implementation, ideally use platform codecs.



On phones, speech is best compressed using AMR - not necessarily better quality / compression, but most likely hardware acceleration since it was used in GSM format. You can usually get AMR straight from the mic.

How do you get large WAV files to your Android device in the first place? If this is actually a microphone output, consider using AMR as described above.

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

+1


source







All Articles