{"id":19346927,"url":"https://github.com/godmode2k/whisper.cpp.android","last_synced_at":"2025-04-13T01:39:28.875Z","repository":{"id":236432466,"uuid":"792602415","full_name":"godmode2k/whisper.cpp.android","owner":"godmode2k","description":"whisper.cpp.android with CLBlast(OpenCL), Translation (Google ML-Kit) and TTS","archived":false,"fork":false,"pushed_at":"2024-11-04T14:08:58.000Z","size":1565,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T01:39:18.577Z","etag":null,"topics":["ai-translation","android","clblast","ggml","kotlin","ml-kit","openai-whisper","opencl","opencl-headers","translation","tts","whisper","whisper-ai","whisper-android","whisper-cpp"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/godmode2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://github.com/godmode2k"]}},"created_at":"2024-04-27T03:25:21.000Z","updated_at":"2025-01-29T18:38:41.000Z","dependencies_parsed_at":"2025-01-06T14:27:11.287Z","dependency_job_id":"75e978c8-a323-4063-bbd4-f716f10265d3","html_url":"https://github.com/godmode2k/whisper.cpp.android","commit_stats":null,"previous_names":["godmode2k/whisper.cpp.android"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fwhisper.cpp.android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fwhisper.cpp.android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fwhisper.cpp.android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fwhisper.cpp.android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godmode2k","download_url":"https://codeload.github.com/godmode2k/whisper.cpp.android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654027,"owners_count":21140236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-translation","android","clblast","ggml","kotlin","ml-kit","openai-whisper","opencl","opencl-headers","translation","tts","whisper","whisper-ai","whisper-android","whisper-cpp"],"created_at":"2024-11-10T04:13:18.243Z","updated_at":"2025-04-13T01:39:28.848Z","avatar_url":"https://github.com/godmode2k.png","language":"Kotlin","readme":"# whisper.cpp.android with Translation and TTS\n\n\nSummary\n----------\n\u003e whisper.cpp.android with CLBlast(OpenCL), Translation (Google ML-Kit) and TTS \u003c/br\u003e\n\u003e \u003c/br\u003e\n\u003e WORK IN-PROGRESS\n\n\nEnvironment\n----------\n\u003e build all and tested on GNU/Linux\n\n    GNU/Linux: Ubuntu 20.04_x64 LTS\n    Android Studio: android-studio-2023.2.1.24\n\n\nTest device\n----------\n\u003e Samsung Galaxy A32 (with CLBlast(OpenCL))\n\n\nBuild\n----------\n```sh\n\n// Working Path: $HOME/work\n$ mkdir $HOME/work \u0026\u0026 cd $HOME/work\n\n// Install Android Studio, SDK, ...\n// Path: /work/android\n//\n// ADB: /work/android/sdk/platform-tools/adb\n\n\n// Clone\n$ git clone https://github.com/godmode2k/whisper.cpp.android\n\n\n// Clone whisper.cpp\n$ git clone https://github.com/ggerganov/whisper.cpp.git\n\n\n// Rename origin dir (whisper.cpp/examples/whisper.android)\n$ mv ./whisper.cpp/examples/whisper.android ./whisper.cpp/examples/whisper.android.old\n\n// Copy whisper.cpp.android \u003cwhisper.cpp path\u003e/examples/\n$ cp -a -r ./whisper.cpp.android/whisper.android ./whisper.cpp/examples/whisper.android\n\n\n---------------------------------\npull libGLES_mali.so file from device\n---------------------------------\nNote: lib path is for Samsung Galaxy A32\n\n\n// Android path: /work/android\n\n\n// SEE: https://github.com/ggerganov/whisper.cpp/tree/master/examples/whisper.android\n\n$ /work/android/sdk/platform-tools/adb pull /system/vendor/lib64/egl/libGLES_mali.so\n\n// rename\n$ cp libGLES_mali.so libOpenCL.so\n\n$ mkdir -p ./whisper.cpp/examples/whisper.android/lib/src/main/jniLibs/arm64-v8a\n$ cp libOpenCL.so ./whisper.cpp/examples/whisper.android/lib/src/main/jniLibs/arm64-v8a\n\n\n---------------------------------\nOpenCL-Headers, library\n---------------------------------\n$ git clone https://github.com/KhronosGroup/OpenCL-Headers.git\n$ cd OpenCL-Headers\n\n//$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/chosen/install/prefix\n//$ cmake --build build --target install\n\n$ cmake -S . -B build\n$ cmake --build build\n\n// result: USE CL/*.h\n\n$ cd ..\n\n// renamed above (libGLES_mali.so == libOpenCL.so)\n$ cp libOpenCL.so ./OpenCL-Headers/\n\n\n---------------------------------\nCBlast\n---------------------------------\n$ git clone https://github.com/CNugteren/CLBlast.git\n$ cd CLBlast\n$ mkdir build \u0026\u0026 cd build\n\n$ /work/android/sdk/cmake/3.22.1/bin/cmake .. \\\n    -DCMAKE_SYSTEM_NAME=Android \\\n    -DCMAKE_SYSTEM_VERSION=33 \\\n    -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \\\n    -DCMAKE_ANDROID_NDK=/work/android/sdk/ndk/25.2.9519653 \\\n    -DCMAKE_ANDROID_STL_TYPE=c++_static \\\n    -DOPENCL_ROOT=/work/OpenCL-Headers \\\n    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \\\n    -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \\\n    -DOPENCL_LIB=/work/libOpenCL.so \\\n\u0026\u0026 make -j4\n\n$ cd ../..\n\n\n---------------------------------\nGGML\n---------------------------------\n$ git clone https://github.com/ggerganov/ggml.git\n$ cd ggml\n$ mkdir build \u0026\u0026 cd build\n\n$ /work/android/sdk/cmake/3.22.1/bin/cmake .. \\\n    -DGGML_CLBLAST=ON \\\n    -DCMAKE_SYSTEM_NAME=Android \\\n    -DCMAKE_SYSTEM_VERSION=33 \\\n    -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \\\n    -DCMAKE_ANDROID_NDK=/work/android/sdk/ndk/25.2.9519653 \\\n    -DCMAKE_ANDROID_STL_TYPE=c++_shared \\\n    -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \\\n    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \\\n    -DCLBLAST_HOME=/work/CLBlast \\\n    -DOPENCL_LIB=/work/libOpenCL.so \\\n\u0026\u0026 make -j4\n\n$ cd ../..\n\n\n---------------------------------\nwhisper.cpp\n---------------------------------\n$ git clone https://github.com/ggerganov/whisper.cpp.git\n$ cd whisper.cpp\n$ make\n\n$ cd ..\n\n\n---------------------------------\ncopy assets\n---------------------------------\n// whisper.cpp Models\nhttps://huggingface.co/ggerganov/whisper.cpp\n\n// Download Model: Tiny\n// https://huggingface.co/ggerganov/whisper.cpp/blob/main/ggml-tiny.bin\n$ mkdir models\n$ wget https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin -P models/\n\n\n// whisper.cpp models\n$ mkdir -p ./whisper.cpp/examples/whisper.android/app/src/main/assets/models\n$ cp ./models/ggml-tiny.bin ./whisper.cpp/examples/whisper.android/app/src/main/assets/models\n\n// whisper.cpp samples\n$ mkdir -p ./whisper.cpp/examples/whisper.android/app/src/main/assets/samples\n$ cp ./whisper.cpp/samples/jfk.wav ./whisper.cpp/examples/whisper.android/app/src/main/assets/samples\n\n\n// libs (.so)\n// NOTE: libs (.so) below is for Samsung Galaxy A32\n//\n// You should find dependencies (.so).\n//\n//\n// [Option #1]\n//\n// e.g., 'libGLES_mali.so' first\n//\n// $ adb pull /system/vendor/lib64/egl/libGLES_mali.so\n// $ readelf -d libGLES_mali.so\n// Dynamic section at offset 0x2537748 contains 42 entries:\n//   Tag        Type                         Name/Value\n//  0x0000000000000001 (NEEDED)             Shared library: [liblog.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libz.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libnativewindow.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libged.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libgpu_aux.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libgpud.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libgralloc_extra.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libcutils.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [android.hardware.graphics.mapper@4.0.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libgralloctypes.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libhidlbase.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libutils.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libm.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libc.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libdl.so]\n//  0x0000000000000001 (NEEDED)             Shared library: [libc++.so]\n//  0x000000000000000e (SONAME)             Library soname: [libGLES_mali.so]\n//  ...\n//\n// then copy (pull) the (NEEDED) .so files.\n// $ mkdir libs\n// $ adb pull \u003cpath\u003e/.so ./libs\n// You have to run 'readelf' for these (NEEDED) .so files again and copy (pull) it.\n//\n// or\n//\n//\n// [Option #2]\n// Easy, but size is too large. I cannot recommend this approach.\n//\n// copy all libs (*.so)\n//\n// (Android device)/system/vendor/lib64/*.so\n// (Android device)/system/vendor/lib64/egl/libGLES_mali.so\n// (Android device)/system/lib64/*.so\n//\n//\n//\n// Below instruction is for [Option #1]\n//\n// NOTE: libs (.so) below is for Samsung Galaxy A32\n//\n$ mkdir libs\n$ adb pull /system/vendor/lib64/egl/libGLES_mali.so ./libs\n$ adb pull /system/vendor/lib64/libged.so ./libs\n$ adb pull /system/vendor/lib64/libgpu_aux.so ./libs\n$ adb pull /system/vendor/lib64/libgpud.so ./libs\n$ adb pull /system/vendor/lib64/libgralloc_extra.so ./libs\n$ adb pull /system/vendor/lib64/libdpframework.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.5.so ./libs\n$ adb pull /system/vendor/lib64/libion_mtk.so ./libs\n$ adb pull /system/vendor/lib64/libpq_prot.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.0.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.1.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.2.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.3.so ./libs\n$ adb pull /system/vendor/lib64/vendor.mediatek.hardware.mms@1.4.so ./libs\n$ adb pull /system/vendor/lib64/libion_ulit.so ./libs\n$ adb pull /system/vendor/lib64/libladder.so ./libs\n//\n$ adb pull /system/lib64/libcutils.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.mapper@4.0.so ./libs\n$ adb pull /system/lib64/libgralloctypes.so ./libs\n$ adb pull /system/lib64/libhidlbase.so ./libs\n$ adb pull /system/lib64/libutils.so ./libs\n$ adb pull /system/lib64/libc++.so ./libs\n$ adb pull /system/lib64/libhardware.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.common@1.0.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.common@1.1.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.common@1.2.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.mapper@2.0.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.mapper@2.1.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.mapper@3.0.so ./libs\n$ adb pull /system/lib64/libion.so ./libs\n$ adb pull /system/lib64/libdmabufheap.so ./libs\n$ adb pull /system/lib64/libutilscallstack.so ./libs\n$ adb pull /system/lib64/libbase.so ./libs\n$ adb pull /system/lib64/android.hardware.graphics.common-V3-ndk.so ./libs\n$ adb pull /system/lib64/libvndksupport.so ./libs\n$ adb pull /system/lib64/libhidlmemory.so ./libs\n$ adb pull /system/lib64/libbacktrace.so ./libs\n$ adb pull /system/lib64/android.hardware.common-V2-ndk.so ./libs\n$ adb pull /system/lib64/libdl_android.so ./libs\n$ adb pull /system/lib64/android.hidl.memory@1.0.so ./libs\n$ adb pull /system/lib64/android.hidl.memory.token@1.0.so ./libs\n$ adb pull /system/lib64/libunwindstack.so ./libs\n$ adb pull /system/lib64/ld-android.so ./libs\n$ adb pull /system/lib64/liblzma.so ./libs\n//\n$ cp ./libs/*.so ./whisper.cpp/examples/whisper.android/lib/src/main/jniLibs/arm64-v8a/\n\n\n---------------------------------\nbuild whisper.android\n---------------------------------\n// Android Studio: gradle.properties\n//\nGGML_HOME=/work/ggml\nGGML_CLBLAST=ON\nCLBLAST_HOME=/work/CLBlast\nOPENCL_LIB=/work/libOpenCL.so\nOPENCL_ROOT=/work/OpenCL-Headers\n\n\n// Android Studio: build.gradle (:lib)\n// Use only here: \"arm64-v8a\"\n//\nndk {\n    //abiFilters \"arm64-v8a\", \"armeabi-v7a\", \"x86\", \"x86_64\n    abiFilters \"arm64-v8a\"\n}\n\n\n// comment-out\n// issues:\n//  - ld: error: unknown argument \"--copy-dt-needed-entries\"\n//\n// (EDIT) /work/ggml/src/CMakeLists.txt:202\n//\n$ vim /work/ggml/src/CMakeLists.txt +202\n(Before)\n        link_libraries(\"-Wl,--copy-dt-needed-entries\")\n(After: comment-out)\n#        link_libraries(\"-Wl,--copy-dt-needed-entries\")\n\n\n// Android Studio\nclean \u0026 rebuild \u0026 run...\n\n\nRun in Release mode is more faster.\n```\n\n\nScreenshots\n----------\n\n\u003e UI #1: Debug mode \u003c/br\u003e\n\u003cimg src=\"https://github.com/godmode2k/whisper.cpp.android/raw/main/screenshots/screenshot1_debug_mode.jpg\" width=\"50%\" height=\"50%\"\u003e\n\n\n\u003e UI #2: Release mode (more faster) \u003c/br\u003e\n\u003cimg src=\"https://github.com/godmode2k/whisper.cpp.android/raw/main/screenshots/screenshot2_release_mode.jpg\" width=\"50%\" height=\"50%\"\u003e\n\n\n\u003e UI #3: Translation Supported Languages \u003c/br\u003e\n\u003cimg src=\"https://github.com/godmode2k/whisper.cpp.android/raw/main/screenshots/screenshot3_translation_supported_langs.jpg\" width=\"50%\" height=\"50%\"\u003e\n\n\n\n","funding_links":["https://github.com/godmode2k"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodmode2k%2Fwhisper.cpp.android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodmode2k%2Fwhisper.cpp.android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodmode2k%2Fwhisper.cpp.android/lists"}