pxhbug123 / SoxLibInAndroid

8 stars 4 forks source link

Include prebuilt binaries #1

Open kcochibili opened 3 years ago

kcochibili commented 3 years ago

I want to say Thank you for creating this project, and I also want to request that you include the prebuilt .so binaries in the project. it will make this sox library easy to get started with

pxhbug123 commented 3 years ago

emm, this project's aim is compile soxlib code to associate with android project. not only how to load so binaries.

kcochibili commented 2 years ago

It would be nice if the project was also usable in a modular way. Not everyone has the C++ skills to repeat all the work youve already done. For example this ffmpeg library, makes it easy to implement by providing prebuilt binaries for arm-v7a, arm-v7a-neon, arm64-v8a, x86 and x86_64 architectures all in the project.

By the way, this is an amazing project you have created, and the only one of its kind.

kcochibili commented 1 year ago

For anybody interested in a plug and play binary that doesn't require building the project first, here is the soxcommandlibrary-release.aar file that I generated from this project.

To use it in your project, copy the file to your android projects libs folder, then in your project level build.gradle file, implement it like this implementation files('libs/soxcommandlibrary-release.aar')

example usage:

import com.vtech.audio.helper.SoxCommandLib;

    public int execSox(List<String> cmds){

        //ensure that the arguments are in the correct Locale format
        String soxCommand = "";

        for (String cmd : cmds)
        {
            cmd = String.format(Locale.US, "%s", cmd);

            soxCommand += (cmd);
            soxCommand += (' ');
        }

        int exitVal = SoxCommandLib.executeCommand(soxCommand);
        if(exitVal == 0){
            Log.v("SOX", "Sox finished successfully");
        }else{
            Log.v("SOX", "Sox failed");
        }

        return exitVal;
    }