diff --git a/library/src/jniLibs/arm64-v8a/liblame-mp3-utils.so b/library/src/jniLibs/arm64-v8a/liblame-mp3-utils.so index d11b796..2421fb1 100755 Binary files a/library/src/jniLibs/arm64-v8a/liblame-mp3-utils.so and b/library/src/jniLibs/arm64-v8a/liblame-mp3-utils.so differ diff --git a/library/src/jniLibs/armeabi-v7a/liblame-mp3-utils.so b/library/src/jniLibs/armeabi-v7a/liblame-mp3-utils.so index f5b6577..9455582 100755 Binary files a/library/src/jniLibs/armeabi-v7a/liblame-mp3-utils.so and b/library/src/jniLibs/armeabi-v7a/liblame-mp3-utils.so differ diff --git a/library/src/jniLibs/mips/liblame-mp3-utils.so b/library/src/jniLibs/mips/liblame-mp3-utils.so index 6b02792..75b95b9 100755 Binary files a/library/src/jniLibs/mips/liblame-mp3-utils.so and b/library/src/jniLibs/mips/liblame-mp3-utils.so differ diff --git a/library/src/jniLibs/mips64/liblame-mp3-utils.so b/library/src/jniLibs/mips64/liblame-mp3-utils.so index 49a6211..873599e 100755 Binary files a/library/src/jniLibs/mips64/liblame-mp3-utils.so and b/library/src/jniLibs/mips64/liblame-mp3-utils.so differ diff --git a/library/src/jniLibs/x86/liblame-mp3-utils.so b/library/src/jniLibs/x86/liblame-mp3-utils.so index 768aa5e..a7c32f2 100755 Binary files a/library/src/jniLibs/x86/liblame-mp3-utils.so and b/library/src/jniLibs/x86/liblame-mp3-utils.so differ diff --git a/library/src/jniLibs/x86_64/liblame-mp3-utils.so b/library/src/jniLibs/x86_64/liblame-mp3-utils.so index 534f61d..0223214 100755 Binary files a/library/src/jniLibs/x86_64/liblame-mp3-utils.so and b/library/src/jniLibs/x86_64/liblame-mp3-utils.so differ diff --git a/library/src/main/cpp/lame-mp3-utils.cpp b/library/src/main/cpp/lame-mp3-utils.cpp index d07d78e..8ebce4e 100644 --- a/library/src/main/cpp/lame-mp3-utils.cpp +++ b/library/src/main/cpp/lame-mp3-utils.cpp @@ -1,7 +1,5 @@ #include"stdio.h" #include"jni.h" -#include"malloc.h" -#include"string.h" #include"lamemp3/lame.h" #include"android/log.h" #define LOG_TAG "lameUtils" @@ -47,9 +45,9 @@ Java_jaygoo_library_converter_Mp3Converter_init(JNIEnv *env, jclass type, jint i extern "C" JNIEXPORT void JNICALL Java_jaygoo_library_converter_Mp3Converter_convertMp3 - (JNIEnv * env, jobject obj, jstring jInput, jstring jMp3) { - const char* cInput = env->GetStringUTFChars(jInput, 0); - const char* cMp3 = env->GetStringUTFChars(jMp3, 0); + (JNIEnv * env, jobject obj, jstring jInputPath, jstring jMp3Path) { + const char* cInput = env->GetStringUTFChars(jInputPath, 0); + const char* cMp3 = env->GetStringUTFChars(jMp3Path, 0); //open input file and output file FILE* fInput = fopen(cInput,"rb"); FILE* fMp3 = fopen(cMp3,"wb"); @@ -66,7 +64,7 @@ void JNICALL Java_jaygoo_library_converter_Mp3Converter_convertMp3 //convert to mp3 do{ - read = static_cast(fread(inputBuffer, sizeof(short int) * 2, 8192, fInput)); + read = static_cast(fread(inputBuffer, sizeof(short int) * 2, BUFFER_SIZE, fInput)); total += read * sizeof(short int)*2; nowConvertBytes = total; if(read != 0){ @@ -84,8 +82,8 @@ void JNICALL Java_jaygoo_library_converter_Mp3Converter_convertMp3 resetLame(); fclose(fInput); fclose(fMp3); - env->ReleaseStringUTFChars(jInput, cInput); - env->ReleaseStringUTFChars(jMp3, cMp3); + env->ReleaseStringUTFChars(jInputPath, cInput); + env->ReleaseStringUTFChars(jMp3Path, cMp3); nowConvertBytes = -1; } diff --git a/library/src/main/java/jaygoo/library/converter/Mp3Converter.java b/library/src/main/java/jaygoo/library/converter/Mp3Converter.java index eed29c5..bdf9e6d 100644 --- a/library/src/main/java/jaygoo/library/converter/Mp3Converter.java +++ b/library/src/main/java/jaygoo/library/converter/Mp3Converter.java @@ -40,12 +40,12 @@ public native static void init(int inSampleRate, int channel, int mode, /** * file convert to mp3 * it may cost a lot of time and better put it in a thread - * @param input + * @param inputPath * file path to be converted - * @param mp3 + * @param mp3Path * mp3 output file path */ - public native static void convertMp3(String input, String mp3); + public native static void convertMp3(String inputPath, String mp3Path); /**