termux-tts 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -2
- package/.github/workflows/release.yml +0 -98
- package/CHANGELOG.md +0 -93
- package/doc.config.yaml +0 -643
- package/docs/benchmarks.md +0 -12
- package/docs/guide.md +0 -552
- package/docs/tts_guide.md +0 -552
- package/install.sh +0 -53
- package/pyproject.toml +0 -80
- package/setup.py +0 -37
- package/termux_tts/__init__.py +0 -80
- package/termux_tts/__main__.py +0 -5
- package/termux_tts/adapter.py +0 -202
- package/termux_tts/audio.py +0 -101
- package/termux_tts/cli.py +0 -159
- package/termux_tts/control/__init__.py +0 -4
- package/termux_tts/control/component.py +0 -398
- package/termux_tts/control/errors.py +0 -52
- package/termux_tts/control/instances.py +0 -137
- package/termux_tts/control/models.py +0 -151
- package/termux_tts/control/status.py +0 -13
- package/termux_tts/downloader.py +0 -30
- package/termux_tts/engine.py +0 -347
- package/termux_tts/engine_expressive.py +0 -216
- package/termux_tts/engine_multilingual.py +0 -409
- package/termux_tts/engine_native.py +0 -104
- package/termux_tts/engine_onnx.py +0 -8
- package/termux_tts/engine_sherpa.py +0 -419
- package/termux_tts/engine_sherpa_capi.py +0 -508
- package/termux_tts/engine_vulkan.py +0 -392
- package/termux_tts/exceptions.py +0 -84
- package/termux_tts/g2p_korean.py +0 -242
- package/termux_tts/hardware.py +0 -297
- package/termux_tts/installer.py +0 -394
- package/termux_tts/script_classifier.py +0 -253
- package/termux_tts/tokenizer.py +0 -186
- package/termux_tts/tokenizer_melo.py +0 -159
- package/termux_tts/transliteration.py +0 -250
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "termux-tts",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "On-device Text-to-Speech framework utilizing device resources (DSP Formant Vocoder, ONNX Neural Runtime & Android Native Voice)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"termux-tts": "bin/cli.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"bin",
|
|
12
|
+
"binding_node",
|
|
13
|
+
"README.md",
|
|
14
|
+
"README.pypi.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
9
17
|
"scripts": {
|
|
10
18
|
"test": "node binding_node/test_node.js",
|
|
11
19
|
"doctor": "node bin/cli.js doctor"
|
|
@@ -54,4 +62,4 @@
|
|
|
54
62
|
"engines": {
|
|
55
63
|
"node": ">=16.0.0"
|
|
56
64
|
}
|
|
57
|
-
}
|
|
65
|
+
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- master
|
|
8
|
-
tags:
|
|
9
|
-
- 'v*'
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
permissions:
|
|
13
|
-
contents: read
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
publish-pypi:
|
|
17
|
-
name: Publish to PyPI
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
steps:
|
|
20
|
-
- name: Checkout repository
|
|
21
|
-
uses: actions/checkout@v4
|
|
22
|
-
|
|
23
|
-
- name: Check if PyPI project exists
|
|
24
|
-
id: check-py
|
|
25
|
-
run: |
|
|
26
|
-
if [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
|
|
27
|
-
echo "has_python=true" >> $GITHUB_OUTPUT
|
|
28
|
-
else
|
|
29
|
-
echo "has_python=false" >> $GITHUB_OUTPUT
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
- name: Set up Python
|
|
33
|
-
if: steps.check-py.outputs.has_python == 'true'
|
|
34
|
-
uses: actions/setup-python@v5
|
|
35
|
-
with:
|
|
36
|
-
python-version: '3.11'
|
|
37
|
-
|
|
38
|
-
- name: Install build dependencies
|
|
39
|
-
if: steps.check-py.outputs.has_python == 'true'
|
|
40
|
-
run: |
|
|
41
|
-
python -m pip install --upgrade pip
|
|
42
|
-
pip install build twine
|
|
43
|
-
|
|
44
|
-
- name: Build distributions
|
|
45
|
-
if: steps.check-py.outputs.has_python == 'true'
|
|
46
|
-
run: python -m build
|
|
47
|
-
|
|
48
|
-
- name: Verify distribution archives
|
|
49
|
-
if: steps.check-py.outputs.has_python == 'true'
|
|
50
|
-
run: twine check dist/*
|
|
51
|
-
|
|
52
|
-
- name: Publish to PyPI
|
|
53
|
-
if: steps.check-py.outputs.has_python == 'true'
|
|
54
|
-
env:
|
|
55
|
-
TWINE_USERNAME: __token__
|
|
56
|
-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
57
|
-
run: |
|
|
58
|
-
twine upload --skip-existing dist/*
|
|
59
|
-
|
|
60
|
-
publish-npm:
|
|
61
|
-
name: Publish to NPM
|
|
62
|
-
runs-on: ubuntu-latest
|
|
63
|
-
steps:
|
|
64
|
-
- name: Checkout repository
|
|
65
|
-
uses: actions/checkout@v4
|
|
66
|
-
|
|
67
|
-
- name: Set up Node.js
|
|
68
|
-
uses: actions/setup-node@v4
|
|
69
|
-
with:
|
|
70
|
-
node-version: '20'
|
|
71
|
-
registry-url: 'https://registry.npmjs.org'
|
|
72
|
-
|
|
73
|
-
- name: Publish NPM package
|
|
74
|
-
env:
|
|
75
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
76
|
-
run: |
|
|
77
|
-
if [ -f "package.json" ]; then
|
|
78
|
-
PKG_NAME=$(node -p "require('./package.json').name")
|
|
79
|
-
PKG_VER=$(node -p "require('./package.json').version")
|
|
80
|
-
if [ "$(npm view ${PKG_NAME}@${PKG_VER} version 2>/dev/null)" = "${PKG_VER}" ]; then
|
|
81
|
-
echo "Version ${PKG_VER} of ${PKG_NAME} is already published on NPM. Skipping."
|
|
82
|
-
else
|
|
83
|
-
echo "Publishing ${PKG_NAME}@${PKG_VER} to NPM..."
|
|
84
|
-
npm publish --access public
|
|
85
|
-
fi
|
|
86
|
-
elif [ -f "npm/package.json" ]; then
|
|
87
|
-
cd npm
|
|
88
|
-
PKG_NAME=$(node -p "require('./package.json').name")
|
|
89
|
-
PKG_VER=$(node -p "require('./package.json').version")
|
|
90
|
-
if [ "$(npm view ${PKG_NAME}@${PKG_VER} version 2>/dev/null)" = "${PKG_VER}" ]; then
|
|
91
|
-
echo "Version ${PKG_VER} of ${PKG_NAME} is already published on NPM. Skipping."
|
|
92
|
-
else
|
|
93
|
-
echo "Publishing ${PKG_NAME}@${PKG_VER} to NPM..."
|
|
94
|
-
npm publish --access public
|
|
95
|
-
fi
|
|
96
|
-
else
|
|
97
|
-
echo "No package.json found. Skipping NPM publish."
|
|
98
|
-
fi
|
package/CHANGELOG.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [1.5.0] - 2026-09-15
|
|
6
|
-
|
|
7
|
-
### Added & Architecture Overhaul
|
|
8
|
-
- **100% Native Vulkan Hardware GPU Acceleration**:
|
|
9
|
-
- Eradicated Mesa CPU software emulation (`llvmpipe`) by enforcing direct vendor Android system ABI binding (`/system/lib64/libvulkan.so`), resolving previous GPU slowdowns and achieving true hardware shader acceleration.
|
|
10
|
-
- Empirically verified on physical Android 16 fleet:
|
|
11
|
-
- **Galaxy S21** (Exynos 2100 / ARM Mali-G78): **RTF 2.2055x** (9,371ms compute, 4.25s speech)
|
|
12
|
-
- **Galaxy S25** (Snapdragon 8 Elite / Qualcomm Adreno 830): **RTF 3.8145x** (16,208ms compute, 4.25s speech)
|
|
13
|
-
- **Galaxy S22** (Snapdragon 8 Gen 1 / Qualcomm Adreno 730): **RTF 8.9159x** (38,092ms compute, 4.27s speech)
|
|
14
|
-
- **Galaxy A35** (Exynos 1380 / ARM Mali-G68 MP5): **RTF 12.1505x** (51,912ms compute, 4.27s speech)
|
|
15
|
-
- **Zero-Tolerance Anti-Deception & Fail-Fast Standard**:
|
|
16
|
-
- Permanently abolished all deceptive CPU offloading, chained fallback blocks, and unlogged exception catching in `VulkanNeuralEngine`.
|
|
17
|
-
- Introduced standardized Fail-Fast error codes: `[AMEVA-TTS-E001]` (Missing Binary/Model Weights), `[AMEVA-TTS-E002]` (Vulkan Runtime Execution Error), and `[AMEVA-TTS-E003]` (Buffer Truncation).
|
|
18
|
-
- Purged coupled legacy code (`engine_dsp.py`) under the AOSF Deletion-First protocol.
|
|
19
|
-
- **Dynamic Path Resolution (Zero Hardcoded Paths)**:
|
|
20
|
-
- Eliminated all absolute file system assumptions (`/data/data/com.termux/files/home/...`), replacing them with dynamic candidate sets leveraging `$PREFIX`, `sys.prefix`, `$HOME`, and `$PATH`.
|
|
21
|
-
- **MeloTTS Hardware Pipeline & Tokenizer**:
|
|
22
|
-
- Introduced standalone `MeloTokenizer` supporting phoneme, tone, and lexicon tensor construction (`x`, `tones`, `sid`, `length_scale`).
|
|
23
|
-
- Implemented dual C++ native ABI backends for HiFi-GAN NCNN Slicing (`melo-ncnn-cli`) and MNN Vulkan execution (`melo-mnn-cli`).
|
|
24
|
-
- Documented mobile GPU shader memory constraints (32MB `maxBufferSize` limit in mobile drivers vs. 52.4MB single-layer ConvTranspose).
|
|
25
|
-
- **Test Suite Modernization**:
|
|
26
|
-
- Added dedicated unit tests (`test_vulkan_melo.py`, `test_nextgen_models.py`) with 100% passing test coverage (53 passed, 10 skipped, 0 failures).
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### Added
|
|
32
|
-
- **Multilingual Neural Orchestrator**: Integrated `MultilingualNeuralEngine` capable of dynamic cross-language code-switching across 9 official languages (ko, en, ja, zh, hi, ru, es, fr, de).
|
|
33
|
-
- **Resident C-API Acceleration**: Implemented `SherpaResidentManager` and `SherpaCapiSession` for in-memory model caching via direct C-API bindings, achieving sub-0.18x RTF and eliminating subprocess invocation overhead.
|
|
34
|
-
- **Zero-Config CLI Ergonomics**: Promoted speech synthesis (`synth`) as the default top-level subcommand; allows direct positional text (`termux-tts "text" --play`); eliminated necessity of `-e multilingual` flag.
|
|
35
|
-
- **Universal Unicode Script Classifier**: Built `MultilingualTokenizer` covering Hangul, Latin, Devanagari (Hindi), Cyrillic (Russian), CJK, and Arabic scripts with 50ms smooth pause padding.
|
|
36
|
-
- **On-Demand Model Provisioning & Self-Healing**: Enhanced `termux-tts install` to provision English/Korean by default, with on-demand flags (`--models hi/ja/ru/zh/all`) and actionable English guidance with absolute paths for uninstalled models.
|
|
37
|
-
- **Defensive Path Resolution**: Hardened path parsing across `AudioBuffer.save()` and CLI entrypoints with automatic directory creation and `Path.expanduser()` resolution.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## [1.4.3] - 2026-09-07
|
|
42
|
-
|
|
43
|
-
### Added
|
|
44
|
-
- **Multi-Tier Dynamic Candidate Resolution**: Replaced single hardcoded `v1.0.0-vulkan` URL in `installer.py` with 4-tier candidate resolution (`TERMUX_TTS_RELEASE_TAG`, `v{__version__}`, `releases/latest/download`, `uno-km/ameva-runtime` SSOT fallback, and companion fallback).
|
|
45
|
-
- **Dual-Path Installation**: Installs and links precompiled Vulkan binary `sherpa-ncnn-offline-tts` to both `~/.local/bin` and `$PREFIX/bin` for instant global PATH resolution.
|
|
46
|
-
- **Dynamic SSOT User-Agent**: Injects dynamic package version into download requests.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## [1.4.2] - 2026-09-07
|
|
51
|
-
|
|
52
|
-
### Added
|
|
53
|
-
- Complete 12-tier enterprise English documentation overhaul for PyPI and GitHub/NPM.
|
|
54
|
-
- Detailed empirical mobile hardware benchmarks (Snapdragon 8 Elite / Adreno 830, Exynos 1380 / Mali-G68 MP5).
|
|
55
|
-
- Full GPU interconnect architecture documentation with SPIR-V compute shader details.
|
|
56
|
-
- Comprehensive CPU vs. GPU thermal dissipation and latency trade-off analysis.
|
|
57
|
-
- 3-stage 24/7 unattended background execution guide (Termux wake-lock, battery optimization, ADB phantom process killer).
|
|
58
|
-
- Expanded technical SEO metadata keywords (34 keywords).
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## [1.4.1] - 2026-09-07
|
|
63
|
-
|
|
64
|
-
### Fixed
|
|
65
|
-
- Fixed npm package.json bin path specification (removed './' prefix).
|
|
66
|
-
- Integrated GitHub Actions automated CI/CD release workflow.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## [1.4.0] - 2026-09-07
|
|
71
|
-
|
|
72
|
-
### Added
|
|
73
|
-
- Direct integration with `TtsAdapter` from `ameva_runtime.adapters` SSOT.
|
|
74
|
-
- Dual-tier VITS Vulkan neural engine routing with strict Fail-Fast error semantics.
|
|
75
|
-
- English localization for all diagnostics, logs, and exception messages.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## [1.1.5] - 2026-09-05
|
|
80
|
-
|
|
81
|
-
### Changed
|
|
82
|
-
- Synchronized install.sh hardware diagnostics binding to ameva-runtime.
|
|
83
|
-
- Modernized 12-stage hardware diagnostic bridge and documentation architecture diagrams.
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## [1.1.4] - 2026-09-05
|
|
88
|
-
|
|
89
|
-
### Changed
|
|
90
|
-
- Migrated hardware acceleration dependency to unified `ameva-runtime>=2.0.0` and `@ameva/runtime>=2.0.0`.
|
|
91
|
-
- Synchronized Python and npm package versions to v1.1.4.
|
|
92
|
-
|
|
93
|
-
|