Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / speech / build.gradle.kts
build.gradle.kts41 lines · 1.8 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-app") |
| 3 | // Listing screenshots come from Compose previews (src/screenshotTest), not from an |
| 4 | // instrumented test on a device. Same `:speech:metadata` task name either way. |
| 5 | id("common-conventions-preview-metadata") |
| 6 | alias(libs.plugins.ksp) |
| 7 | } |
| 8 | |
| 9 | launcherIcon { |
| 10 | symbol = "record_voice_over" |
| 11 | } |
| 12 | |
| 13 | android { |
| 14 | defaultConfig { |
| 15 | applicationId = "com.vayunmathur.speech" |
| 16 | } |
| 17 | |
| 18 | androidResources { |
| 19 | // Load-bearing, not an optimisation. `AssetManager.openFd` throws for a deflated entry, |
| 20 | // and the fd is how Supertonic's ~105 MB and whisper-base's 70.6 MiB of weights reach the |
| 21 | // GPU without being copied through the Java heap three times - see |
| 22 | // SupertonicSynthesizer.inAssets and WhisperHandle.inAssets. It costs nothing on download |
| 23 | // size either: int8 and fp16 weights are already incompressible. |
| 24 | noCompress += "maml" |
| 25 | } |
| 26 | } |
| 27 | dependencies { |
| 28 | // Both directions run on :library:ml, our own Vulkan compute runtime, and this app links no |
| 29 | // third-party inference runtime at all. |
| 30 | // |
| 31 | // Text-to-speech is Supertonic 3: four networks for all 31 languages, every one of them on the |
| 32 | // GPU - the duration predictor, the text encoder, a flow-matching sampler and a ConvNeXt |
| 33 | // vocoder. Speech-to-text is whisper-base, one 70.6 MiB `.maml` holding a 6-layer audio encoder |
| 34 | // and a 6-layer KV-cached decoder, with the decode loop in `post::whisper`. |
| 35 | // |
| 36 | // Both bundles ship in `assets/` and are streamed from a file descriptor, which is what |
| 37 | // `noCompress += "maml"` above is for. |
| 38 | implementation(project(":library:ml")) |
| 39 | // No `:library:downloadservice` and no DataStore: both models ship in the APK, so this app |
| 40 | // downloads nothing and stores no preferences. They went when Piper's 1,834 MB of voices did. |
| 41 | } |