Skip to content

Commit 2e0fc05

Browse files
committed
push android app for whisperkit
1 parent 92ad516 commit 2e0fc05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+7238
-0
lines changed

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,34 @@ cache/
88
external/
99
test/dataset/
1010

11+
.vscode/
12+
1113
# Never exclude src files
1214
!WhisperKit/**
1315
!cli/**
1416

1517
# MacOS specific
1618
.DS_Store
19+
20+
### Android ###
21+
# IntelliJ IDEA project files
22+
.idea/
23+
*.iml
24+
*.ipr
25+
*.iws
26+
out/
27+
28+
# Model folder (too large)
29+
androidApp/app/src/main/assets/openai_whisper-tiny/
30+
31+
# Gradle files and caches
32+
.gradle/
33+
34+
# Native build outputs (e.g., C++/JNI)
35+
.cxx/
36+
37+
# Heap dump files
38+
*.hprof
39+
40+
# Log files
41+
*.log

androidApp/app/build.gradle

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
signingConfigs {
8+
release {
9+
}
10+
}
11+
namespace 'com.whispertflite'
12+
compileSdk 34
13+
14+
defaultConfig {
15+
applicationId "com.whispertflite"
16+
minSdk 26
17+
targetSdk 34
18+
versionCode 1
19+
versionName "1.0"
20+
21+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
22+
23+
// Specify the ABIs to exclude
24+
ndk {
25+
abiFilters 'armeabi-v7a', 'arm64-v8a'
26+
}
27+
}
28+
29+
buildTypes {
30+
release {
31+
minifyEnabled false
32+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
33+
signingConfig signingConfigs.debug
34+
}
35+
}
36+
37+
buildFeatures {
38+
compose true
39+
}
40+
composeOptions {
41+
kotlinCompilerExtensionVersion = '1.5.14'
42+
}
43+
// externalNativeBuild {
44+
// cmake {
45+
// path "src/main/cpp/WhisperKitAndroid/CMakeLists.txt"
46+
// }
47+
// }
48+
compileOptions {
49+
sourceCompatibility = JavaVersion.VERSION_11
50+
targetCompatibility = JavaVersion.VERSION_11
51+
}
52+
kotlinOptions {
53+
jvmTarget = '11'
54+
}
55+
}
56+
57+
dependencies {
58+
implementation 'androidx.appcompat:appcompat:1.7.0'
59+
implementation 'com.google.android.material:material:1.12.0'
60+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
61+
62+
// Main TensorFlow Lite library
63+
implementation 'org.tensorflow:tensorflow-lite:2.14.0'
64+
implementation 'org.tensorflow:tensorflow-lite-support:0.4.4'
65+
implementation 'com.google.android.gms:play-services-tflite-gpu:16.4.0'
66+
implementation 'com.google.android.gms:play-services-tflite-java:16.4.0'
67+
implementation 'androidx.compose.ui:ui-android:1.7.6'
68+
implementation 'androidx.compose.foundation:foundation-android:1.7.6'
69+
implementation 'androidx.compose.material3:material3-android:1.3.1'
70+
implementation 'androidx.activity:activity-compose:1.9.0'
71+
72+
}

androidApp/app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.whispertflite">
5+
6+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
7+
<application
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="WhisperASR"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:extractNativeLibs="true"
14+
tools:targetApi="31">
15+
<uses-native-library
16+
android:name="libcdsprpc.so"
17+
android:required="false"/>
18+
<activity android:name="com.whispertflite.MainActivity" android:exported="true">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
24+
</activity>
25+
<activity
26+
android:name="org.libsdl.app.SDLActivity"
27+
android:label="SDL"
28+
android:launchMode="singleTask"
29+
android:exported="false"
30+
>
31+
32+
</activity>
33+
</application>
34+
35+
</manifest>
1.83 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
344 KB
Binary file not shown.

0 commit comments

Comments
 (0)