Why is native libmpg123 taking so long on android with libgdx?

Posted by cmbryan on Stack Overflow See other posts from Stack Overflow or by cmbryan
Published on 2012-05-24T20:53:41Z Indexed on 2012/06/10 16:40 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

I'm trying to use the gdx-audio extensions, but am having trouble decoding mp3s. It works, but very slowly!! A 10-second file is taking 6.57 seconds to decode :( Here is the method:

public void decode() {
    Mpg123Decoder decoder = new Mpg123Decoder(externalFile);

    short[] sampleArray = new short[1024];

    // read until we reach the end of the file
    while (decoder.readSamples(sampleArray, 0, sampleArray.length) > 0) {}
}

Can anyone tell me why this is taking so long?

© Stack Overflow or respective owner

Related posts about java

Related posts about android