├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── net │ │ │ └── qiujuer │ │ │ └── lame │ │ │ └── sample │ │ │ ├── helper │ │ │ ├── AudioPlayHelper.java │ │ │ └── AudioRecordHelper.java │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── net │ │ │ └── qiujuer │ │ │ └── lame │ │ │ └── sample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── net │ │ └── qiujuer │ │ └── lame │ │ └── sample │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── lame ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ ├── libmp3lame │ │ │ │ ├── lameerror.h │ │ │ │ ├── newmdct.h │ │ │ │ ├── vbrquantize.h │ │ │ │ ├── reservoir.h │ │ │ │ ├── fft.h │ │ │ │ ├── quantize.h │ │ │ │ ├── bitstream.h │ │ │ │ ├── id3tag.h │ │ │ │ ├── psymodel.h │ │ │ │ ├── version.h │ │ │ │ ├── l3side.h │ │ │ │ ├── tables.h │ │ │ │ ├── set_get.h │ │ │ │ ├── VbrTag.h │ │ │ │ ├── lame-analysis.h │ │ │ │ ├── gain_analysis.h │ │ │ │ ├── encoder.h │ │ │ │ ├── quantize_pvt.h │ │ │ │ ├── machine.h │ │ │ │ ├── version.c │ │ │ │ ├── lame_global_flags.h │ │ │ │ ├── fft.c │ │ │ │ ├── reservoir.c │ │ │ │ ├── mpglib_interface.c │ │ │ │ ├── presets.c │ │ │ │ └── encoder.c │ │ │ ├── net_qiujuer_lame_Lame.h │ │ │ └── net_qiujuer_lame_Lame.cpp │ │ └── java │ │ │ └── net │ │ │ └── qiujuer │ │ │ └── lame │ │ │ ├── LameOutputStream.java │ │ │ ├── LameAsyncEncoder.java │ │ │ └── Lame.java │ ├── test │ │ └── java │ │ │ └── net │ │ │ └── qiujuer │ │ │ └── lame │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── net │ │ └── qiujuer │ │ └── lame │ │ └── ExampleInstrumentedTest.java ├── gradle.properties ├── CMakeLists.txt ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── README.md ├── art ├── mp3 bit rates.png └── mp3 sampling rates.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── script ├── make-jar.gradle └── gradle-jcenter-push.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lame/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':lame' 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LameAndroid 2 | Lame mp3 converter with android. 3 | -------------------------------------------------------------------------------- /art/mp3 bit rates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/art/mp3 bit rates.png -------------------------------------------------------------------------------- /art/mp3 sampling rates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/art/mp3 sampling rates.png -------------------------------------------------------------------------------- /lame/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Lame 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LameAndroid 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /lame/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_BINTRAY_NAME=net.qiujuer.lame:lame 2 | POM_DESCRIPTION=Lame mp3 converter with android. 3 | POM_ARTIFACT_ID=lame -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiujuer/LameAndroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jan 22 14:26:10 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /lame/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /script/make-jar.gradle: -------------------------------------------------------------------------------- 1 | task clearJar(type: Delete) { 2 | delete 'release/' + POM_ARTIFACT_ID + '_' + VERSION_NAME + '.jar' 3 | } 4 | 5 | task makeJar(type: Copy) { 6 | from('build/intermediates/bundles/release/') 7 | into('release/') 8 | include('classes.jar') 9 | rename('classes.jar', POM_ARTIFACT_ID + '_' + VERSION_NAME + '.jar') 10 | } 11 | makeJar.dependsOn(clearJar, build) -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /lame/src/test/java/net/qiujuer/lame/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package net.qiujuer.lame; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/test/java/net/qiujuer/lame/sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package net.qiujuer.lame.sample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /lame/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | #设置变量SRC_DIR为libmp3lame的所在路径 4 | set(SRC_DIR src/main/cpp/libmp3lame) 5 | 6 | #指定头文件所在,可以多次调用,指定多个路径 7 | include_directories(src/main/cpp/libmp3lame) 8 | 9 | #设定一个目录 10 | aux_source_directory(src/main/cpp/libmp3lame SRC_LIST) 11 | 12 | add_library( mp3lame-lib 13 | 14 | SHARED 15 | 16 | src/main/cpp/net_qiujuer_lame_Lame.cpp 17 | 18 | ${SRC_LIST}) 19 | 20 | find_library( log-lib 21 | log) 22 | 23 | target_link_libraries( mp3lame-lib 24 | 25 | ${log-lib} ) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | /local.properties/ 43 | .idea/ 44 | .DS_Store 45 | /build 46 | /captures 47 | .externalNativeBuild 48 | -------------------------------------------------------------------------------- /lame/src/main/cpp/libmp3lame/lameerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A collection of LAME Error Codes 3 | * 4 | * Please use the constants defined here instead of some arbitrary 5 | * values. Currently the values starting at -10 to avoid intersection 6 | * with the -1, -2, -3 and -4 used in the current code. 7 | * 8 | * May be this should be a part of the include/lame.h. 9 | */ 10 | 11 | typedef enum { 12 | LAME_OKAY = 0, 13 | LAME_NOERROR = 0, 14 | LAME_GENERICERROR = -1, 15 | LAME_NOMEM = -10, 16 | LAME_BADBITRATE = -11, 17 | LAME_BADSAMPFREQ = -12, 18 | LAME_INTERNALERROR = -13, 19 | 20 | FRONTEND_READERROR = -80, 21 | FRONTEND_WRITEERROR = -81, 22 | FRONTEND_FILETOOLARGE = -82, 23 | 24 | } lame_errorcodes_t; 25 | 26 | /* end of lameerror.h */ 27 | -------------------------------------------------------------------------------- /lame/src/androidTest/java/net/qiujuer/lame/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package net.qiujuer.lame; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("net.qiujuer.lame.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/androidTest/java/net/qiujuer/lame/sample/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package net.qiujuer.lame.sample; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("net.qiujuer.lame.sample", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/qiujuer/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /lame/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/qiujuer/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /lame/src/main/cpp/libmp3lame/newmdct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * New Modified DCT include file 3 | * 4 | * Copyright (c) 1999 Takehiro TOMINAGA 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef LAME_NEWMDCT_H 23 | #define LAME_NEWMDCT_H 24 | 25 | void mdct_sub48(lame_internal_flags * gfc, const sample_t * w0, const sample_t * w1); 26 | 27 | #endif /* LAME_NEWMDCT_H */ 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 |