Git Product home page Git Product logo

Comments (4)

badboy-tian avatar badboy-tian commented on July 16, 2024 1

put the libaac-encoder in to the armeabi-v7a and armeabi

from android-aac-enc.

badboy-tian avatar badboy-tian commented on July 16, 2024 1

final String name = files.get(postion).getParentFile().getAbsolutePath() + "/" + files.get(postion).getName().replace(".wav", ".mp4");

    AACEncoder aacEncoder = new AACEncoder();
    ByteArrayOutputStream bos = null;
    int size = 0;
    byte[] buffer = null;
    try {
        File file = files.get(postion);
        FileInputStream fis = new FileInputStream(file);

        bos = new ByteArrayOutputStream();
        byte[] b = new byte[1000];
        int n;
        while ((n = fis.read(b)) != -1) {
            bos.write(b, 0, n);
        }

        bos.size();
        fis.close();
        bos.close();
        buffer = bos.toByteArray();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    Uri uri = Uri.parse(files.get(postion).getAbsolutePath());
    MediaMetadataRetriever mmr = new MediaMetadataRetriever();
    mmr.setDataSource(this,uri);
    String durationStr = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
    int millSecond = Integer.parseInt(durationStr);

    int bitRate = Integer.parseInt(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE));
    Log.e("xxx", bitRate + "");

    aacEncoder.init(bitRate, 1, 44100, 16, name.replace(".mp4", ".aac"));
    aacEncoder.encode(buffer);



    aacEncoder.uninit();

work normal!

from android-aac-enc.

taraspaliy avatar taraspaliy commented on July 16, 2024

Having the same....what might be the problem?

from android-aac-enc.

PoetGcc avatar PoetGcc commented on July 16, 2024

Having the same....

from android-aac-enc.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.