termux-stt 1.2.11 → 1.2.12
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/README.md +77 -77
- package/README.pypi.md +44 -44
- package/bin/cli.js +51 -51
- package/bin/termux-stt.js +51 -51
- package/index.d.ts +1 -1
- package/package.json +87 -87
package/README.md
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
# Termux-STT
|
|
2
|
-
|
|
3
|
-
[](https://pypi.org/project/termux-stt/)
|
|
4
|
-
[](https://pypi.org/project/termux-stt/)
|
|
5
|
-
[](https://www.npmjs.com/package/termux-stt)
|
|
6
|
-
[](https://www.npmjs.com/package/termux-stt)
|
|
7
|
-
[](https://github.com/uno-km/termux-stt)
|
|
8
|
-
|
|
9
|
-
> **디바이스 리소스를 활용한 통합 온디바이스 음성인식(STT) 및 순수 Python 128d X-Vector 화자 분리 프레임워크**
|
|
10
|
-
> *Unified On-Device Speech-to-Text Utilizing Device Resources & Pure Python 128d X-Vector Speaker Diarization*
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Architecture & Overview
|
|
15
|
-
|
|
16
|
-
Whisper.cpp, Vosk, Sherpa-ONNX 3대 네이티브 엔진을 통합하고, 닫힌 형태 순수 Python 128차원 X-Vector 클러스터링을 결합하여 80MB 미만의 초경량 메모리로 100% 온디바이스 실시간 음성인식과 화자 분리를 구현합니다.
|
|
17
|
-
|
|
18
|
-
Integrates Whisper.cpp, Vosk, and Sherpa-ONNX with a closed-form pure-Python 128-dimensional X-Vector clustering algorithm that operates in under 80MB RAM with zero cloud egress.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Installation & Quickstart
|
|
23
|
-
|
|
24
|
-
### Python (PyPI)
|
|
25
|
-
```bash
|
|
26
|
-
pip install termux-stt
|
|
27
|
-
```
|
|
28
|
-
```python
|
|
29
|
-
from termux_stt import create_engine
|
|
30
|
-
|
|
31
|
-
# 1. Initialize Engine (auto-loads native ARM NEON binary & cached model)
|
|
32
|
-
engine = create_engine("whisper", model="tiny", lang="en", threads=4)
|
|
33
|
-
|
|
34
|
-
# 2. Transcribe Audio directly into Subtitles
|
|
35
|
-
result = engine.transcribe("samples/jfk_1min.wav")
|
|
36
|
-
print("Transcript:\n", result.text)
|
|
37
|
-
print("SRT Subtitles:\n", result.to_srt())
|
|
38
|
-
|
|
39
|
-
# 3. 2-Speaker Diarization without PyTorch
|
|
40
|
-
hybrid = create_engine("hybrid", lang="en", num_speakers=2)
|
|
41
|
-
diar_result = hybrid.diarize("samples/jfk_1min.wav")
|
|
42
|
-
for seg in diar_result.segments:
|
|
43
|
-
print(f"[{seg.speaker}] ({seg.start:.1f}s -> {seg.end:.1f}s): {seg.text}")
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Node.js / TypeScript (npm)
|
|
48
|
-
```bash
|
|
49
|
-
npm install termux-stt
|
|
50
|
-
```
|
|
51
|
-
```typescript
|
|
52
|
-
const { createEngine } = require("termux-stt");
|
|
53
|
-
|
|
54
|
-
async function main() {
|
|
55
|
-
// 1. Initialize Whisper Engine
|
|
56
|
-
const engine = createEngine("whisper", { model: "tiny", lang: "en", threads: 4 });
|
|
57
|
-
|
|
58
|
-
// 2. Transcribe Audio
|
|
59
|
-
const result = await engine.transcribe("samples/jfk_1min.wav");
|
|
60
|
-
console.log("Transcript:", result.text);
|
|
61
|
-
console.log("SRT Subtitles:\n", result.toSrt());
|
|
62
|
-
}
|
|
63
|
-
main();
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Official Documentation & Benchmarks
|
|
70
|
-
- [Official Architecture & API Reference](https://uno-km.vercel.app/lib/stt/)
|
|
71
|
-
- [Ecosystem Metrics & Registry Stats](https://uno-km.vercel.app/foundation/metrics)
|
|
72
|
-
- [AMEVA Open-Source Foundation Portal](https://uno-km.vercel.app/foundation/index.html)
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## License
|
|
77
|
-
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)).
|
|
1
|
+
# Termux-STT
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/termux-stt/)
|
|
4
|
+
[](https://pypi.org/project/termux-stt/)
|
|
5
|
+
[](https://www.npmjs.com/package/termux-stt)
|
|
6
|
+
[](https://www.npmjs.com/package/termux-stt)
|
|
7
|
+
[](https://github.com/uno-km/termux-stt)
|
|
8
|
+
|
|
9
|
+
> **디바이스 리소스를 활용한 통합 온디바이스 음성인식(STT) 및 순수 Python 128d X-Vector 화자 분리 프레임워크**
|
|
10
|
+
> *Unified On-Device Speech-to-Text Utilizing Device Resources & Pure Python 128d X-Vector Speaker Diarization*
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Architecture & Overview
|
|
15
|
+
|
|
16
|
+
Whisper.cpp, Vosk, Sherpa-ONNX 3대 네이티브 엔진을 통합하고, 닫힌 형태 순수 Python 128차원 X-Vector 클러스터링을 결합하여 80MB 미만의 초경량 메모리로 100% 온디바이스 실시간 음성인식과 화자 분리를 구현합니다.
|
|
17
|
+
|
|
18
|
+
Integrates Whisper.cpp, Vosk, and Sherpa-ONNX with a closed-form pure-Python 128-dimensional X-Vector clustering algorithm that operates in under 80MB RAM with zero cloud egress.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation & Quickstart
|
|
23
|
+
|
|
24
|
+
### Python (PyPI)
|
|
25
|
+
```bash
|
|
26
|
+
pip install termux-stt
|
|
27
|
+
```
|
|
28
|
+
```python
|
|
29
|
+
from termux_stt import create_engine
|
|
30
|
+
|
|
31
|
+
# 1. Initialize Engine (auto-loads native ARM NEON binary & cached model)
|
|
32
|
+
engine = create_engine("whisper", model="tiny", lang="en", threads=4)
|
|
33
|
+
|
|
34
|
+
# 2. Transcribe Audio directly into Subtitles
|
|
35
|
+
result = engine.transcribe("samples/jfk_1min.wav")
|
|
36
|
+
print("Transcript:\n", result.text)
|
|
37
|
+
print("SRT Subtitles:\n", result.to_srt())
|
|
38
|
+
|
|
39
|
+
# 3. 2-Speaker Diarization without PyTorch
|
|
40
|
+
hybrid = create_engine("hybrid", lang="en", num_speakers=2)
|
|
41
|
+
diar_result = hybrid.diarize("samples/jfk_1min.wav")
|
|
42
|
+
for seg in diar_result.segments:
|
|
43
|
+
print(f"[{seg.speaker}] ({seg.start:.1f}s -> {seg.end:.1f}s): {seg.text}")
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Node.js / TypeScript (npm)
|
|
48
|
+
```bash
|
|
49
|
+
npm install termux-stt
|
|
50
|
+
```
|
|
51
|
+
```typescript
|
|
52
|
+
const { createEngine } = require("termux-stt");
|
|
53
|
+
|
|
54
|
+
async function main() {
|
|
55
|
+
// 1. Initialize Whisper Engine
|
|
56
|
+
const engine = createEngine("whisper", { model: "tiny", lang: "en", threads: 4 });
|
|
57
|
+
|
|
58
|
+
// 2. Transcribe Audio
|
|
59
|
+
const result = await engine.transcribe("samples/jfk_1min.wav");
|
|
60
|
+
console.log("Transcript:", result.text);
|
|
61
|
+
console.log("SRT Subtitles:\n", result.toSrt());
|
|
62
|
+
}
|
|
63
|
+
main();
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Official Documentation & Benchmarks
|
|
70
|
+
- [Official Architecture & API Reference](https://uno-km.vercel.app/lib/stt/)
|
|
71
|
+
- [Ecosystem Metrics & Registry Stats](https://uno-km.vercel.app/foundation/metrics)
|
|
72
|
+
- [AMEVA Open-Source Foundation Portal](https://uno-km.vercel.app/foundation/index.html)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)).
|
package/README.pypi.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# Termux-STT (Python)
|
|
2
|
-
|
|
3
|
-
[](https://pypi.org/project/termux-stt/)
|
|
4
|
-
[](https://pypi.org/project/termux-stt/)
|
|
5
|
-
[](https://github.com/uno-km/termux-stt)
|
|
6
|
-
|
|
7
|
-
> Unified On-Device Speech-to-Text Utilizing Device Resources & Pure Python 128d X-Vector Speaker Diarization
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pip install termux-stt
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Quickstart
|
|
16
|
-
|
|
17
|
-
```python
|
|
18
|
-
from termux_stt import create_engine
|
|
19
|
-
|
|
20
|
-
# 1. Initialize Engine (auto-loads native ARM NEON binary & cached model)
|
|
21
|
-
engine = create_engine("whisper", model="tiny", lang="en", threads=4)
|
|
22
|
-
|
|
23
|
-
# 2. Transcribe Audio directly into Subtitles
|
|
24
|
-
result = engine.transcribe("samples/jfk_1min.wav")
|
|
25
|
-
print("Transcript:\n", result.text)
|
|
26
|
-
print("SRT Subtitles:\n", result.to_srt())
|
|
27
|
-
|
|
28
|
-
# 3. 2-Speaker Diarization without PyTorch
|
|
29
|
-
hybrid = create_engine("hybrid", lang="en", num_speakers=2)
|
|
30
|
-
diar_result = hybrid.diarize("samples/jfk_1min.wav")
|
|
31
|
-
for seg in diar_result.segments:
|
|
32
|
-
print(f"[{seg.speaker}] ({seg.start:.1f}s -> {seg.end:.1f}s): {seg.text}")
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Description
|
|
37
|
-
Integrates Whisper.cpp, Vosk, and Sherpa-ONNX with a closed-form pure-Python 128-dimensional X-Vector clustering algorithm that operates in under 80MB RAM with zero cloud egress.
|
|
38
|
-
|
|
39
|
-
## Documentation
|
|
40
|
-
- [Official Documentation & API Reference](https://uno-km.vercel.app/lib/stt/)
|
|
41
|
-
- [GitHub Repository](https://github.com/uno-km/termux-stt)
|
|
42
|
-
|
|
43
|
-
## License
|
|
44
|
-
Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).
|
|
1
|
+
# Termux-STT (Python)
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/termux-stt/)
|
|
4
|
+
[](https://pypi.org/project/termux-stt/)
|
|
5
|
+
[](https://github.com/uno-km/termux-stt)
|
|
6
|
+
|
|
7
|
+
> Unified On-Device Speech-to-Text Utilizing Device Resources & Pure Python 128d X-Vector Speaker Diarization
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install termux-stt
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quickstart
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from termux_stt import create_engine
|
|
19
|
+
|
|
20
|
+
# 1. Initialize Engine (auto-loads native ARM NEON binary & cached model)
|
|
21
|
+
engine = create_engine("whisper", model="tiny", lang="en", threads=4)
|
|
22
|
+
|
|
23
|
+
# 2. Transcribe Audio directly into Subtitles
|
|
24
|
+
result = engine.transcribe("samples/jfk_1min.wav")
|
|
25
|
+
print("Transcript:\n", result.text)
|
|
26
|
+
print("SRT Subtitles:\n", result.to_srt())
|
|
27
|
+
|
|
28
|
+
# 3. 2-Speaker Diarization without PyTorch
|
|
29
|
+
hybrid = create_engine("hybrid", lang="en", num_speakers=2)
|
|
30
|
+
diar_result = hybrid.diarize("samples/jfk_1min.wav")
|
|
31
|
+
for seg in diar_result.segments:
|
|
32
|
+
print(f"[{seg.speaker}] ({seg.start:.1f}s -> {seg.end:.1f}s): {seg.text}")
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Description
|
|
37
|
+
Integrates Whisper.cpp, Vosk, and Sherpa-ONNX with a closed-form pure-Python 128-dimensional X-Vector clustering algorithm that operates in under 80MB RAM with zero cloud egress.
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
- [Official Documentation & API Reference](https://uno-km.vercel.app/lib/stt/)
|
|
41
|
+
- [GitHub Repository](https://github.com/uno-km/termux-stt)
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).
|
package/bin/cli.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* AMEVA Standard Node.js CLI Runner for termux_stt.
|
|
4
|
-
* Automatically resolves Python 3 environment and dispatches to python -m termux_stt.
|
|
5
|
-
*/
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const { spawn, execSync } = require('child_process');
|
|
8
|
-
|
|
9
|
-
function findPython() {
|
|
10
|
-
if (process.env.PYTHON && fs.existsSync(process.env.PYTHON)) {
|
|
11
|
-
return process.env.PYTHON;
|
|
12
|
-
}
|
|
13
|
-
const termuxBin = '/data/data/com.termux/files/usr/bin/python3';
|
|
14
|
-
if (fs.existsSync(termuxBin)) {
|
|
15
|
-
return termuxBin;
|
|
16
|
-
}
|
|
17
|
-
const termuxBinAlt = '/data/data/com.termux/files/usr/bin/python';
|
|
18
|
-
if (fs.existsSync(termuxBinAlt)) {
|
|
19
|
-
return termuxBinAlt;
|
|
20
|
-
}
|
|
21
|
-
const candidates = ['python3', 'python'];
|
|
22
|
-
for (const cmd of candidates) {
|
|
23
|
-
try {
|
|
24
|
-
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
|
|
25
|
-
const res = execSync(checkCmd, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
26
|
-
if (res) return cmd;
|
|
27
|
-
} catch (_) {}
|
|
28
|
-
}
|
|
29
|
-
return 'python3';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const pythonBin = findPython();
|
|
33
|
-
const args = ['-m', 'termux_stt', ...process.argv.slice(2)];
|
|
34
|
-
|
|
35
|
-
const child = spawn(pythonBin, args, {
|
|
36
|
-
stdio: 'inherit',
|
|
37
|
-
env: process.env
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
child.on('error', (err) => {
|
|
41
|
-
console.error(`[${'termux_stt'}] Failed to spawn python process (${pythonBin}):`, err.message);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
child.on('exit', (code, signal) => {
|
|
46
|
-
if (signal) {
|
|
47
|
-
process.kill(process.pid, signal);
|
|
48
|
-
} else {
|
|
49
|
-
process.exit(code || 0);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AMEVA Standard Node.js CLI Runner for termux_stt.
|
|
4
|
+
* Automatically resolves Python 3 environment and dispatches to python -m termux_stt.
|
|
5
|
+
*/
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const { spawn, execSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
function findPython() {
|
|
10
|
+
if (process.env.PYTHON && fs.existsSync(process.env.PYTHON)) {
|
|
11
|
+
return process.env.PYTHON;
|
|
12
|
+
}
|
|
13
|
+
const termuxBin = '/data/data/com.termux/files/usr/bin/python3';
|
|
14
|
+
if (fs.existsSync(termuxBin)) {
|
|
15
|
+
return termuxBin;
|
|
16
|
+
}
|
|
17
|
+
const termuxBinAlt = '/data/data/com.termux/files/usr/bin/python';
|
|
18
|
+
if (fs.existsSync(termuxBinAlt)) {
|
|
19
|
+
return termuxBinAlt;
|
|
20
|
+
}
|
|
21
|
+
const candidates = ['python3', 'python'];
|
|
22
|
+
for (const cmd of candidates) {
|
|
23
|
+
try {
|
|
24
|
+
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
|
|
25
|
+
const res = execSync(checkCmd, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
26
|
+
if (res) return cmd;
|
|
27
|
+
} catch (_) {}
|
|
28
|
+
}
|
|
29
|
+
return 'python3';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const pythonBin = findPython();
|
|
33
|
+
const args = ['-m', 'termux_stt', ...process.argv.slice(2)];
|
|
34
|
+
|
|
35
|
+
const child = spawn(pythonBin, args, {
|
|
36
|
+
stdio: 'inherit',
|
|
37
|
+
env: process.env
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('error', (err) => {
|
|
41
|
+
console.error(`[${'termux_stt'}] Failed to spawn python process (${pythonBin}):`, err.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on('exit', (code, signal) => {
|
|
46
|
+
if (signal) {
|
|
47
|
+
process.kill(process.pid, signal);
|
|
48
|
+
} else {
|
|
49
|
+
process.exit(code || 0);
|
|
50
|
+
}
|
|
51
|
+
});
|
package/bin/termux-stt.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* AMEVA Standard Node.js CLI Runner for termux_stt.
|
|
4
|
-
* Automatically resolves Python 3 environment and dispatches to python -m termux_stt.
|
|
5
|
-
*/
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const { spawn, execSync } = require('child_process');
|
|
8
|
-
|
|
9
|
-
function findPython() {
|
|
10
|
-
if (process.env.PYTHON && fs.existsSync(process.env.PYTHON)) {
|
|
11
|
-
return process.env.PYTHON;
|
|
12
|
-
}
|
|
13
|
-
const termuxBin = '/data/data/com.termux/files/usr/bin/python3';
|
|
14
|
-
if (fs.existsSync(termuxBin)) {
|
|
15
|
-
return termuxBin;
|
|
16
|
-
}
|
|
17
|
-
const termuxBinAlt = '/data/data/com.termux/files/usr/bin/python';
|
|
18
|
-
if (fs.existsSync(termuxBinAlt)) {
|
|
19
|
-
return termuxBinAlt;
|
|
20
|
-
}
|
|
21
|
-
const candidates = ['python3', 'python'];
|
|
22
|
-
for (const cmd of candidates) {
|
|
23
|
-
try {
|
|
24
|
-
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
|
|
25
|
-
const res = execSync(checkCmd, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
26
|
-
if (res) return cmd;
|
|
27
|
-
} catch (_) {}
|
|
28
|
-
}
|
|
29
|
-
return 'python3';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const pythonBin = findPython();
|
|
33
|
-
const args = ['-m', 'termux_stt.platform.installer', ...process.argv.slice(2)];
|
|
34
|
-
|
|
35
|
-
const child = spawn(pythonBin, args, {
|
|
36
|
-
stdio: 'inherit',
|
|
37
|
-
env: process.env
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
child.on('error', (err) => {
|
|
41
|
-
console.error(`[${'termux_stt'}] Failed to spawn python process (${pythonBin}):`, err.message);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
child.on('exit', (code, signal) => {
|
|
46
|
-
if (signal) {
|
|
47
|
-
process.kill(process.pid, signal);
|
|
48
|
-
} else {
|
|
49
|
-
process.exit(code || 0);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AMEVA Standard Node.js CLI Runner for termux_stt.
|
|
4
|
+
* Automatically resolves Python 3 environment and dispatches to python -m termux_stt.
|
|
5
|
+
*/
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const { spawn, execSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
function findPython() {
|
|
10
|
+
if (process.env.PYTHON && fs.existsSync(process.env.PYTHON)) {
|
|
11
|
+
return process.env.PYTHON;
|
|
12
|
+
}
|
|
13
|
+
const termuxBin = '/data/data/com.termux/files/usr/bin/python3';
|
|
14
|
+
if (fs.existsSync(termuxBin)) {
|
|
15
|
+
return termuxBin;
|
|
16
|
+
}
|
|
17
|
+
const termuxBinAlt = '/data/data/com.termux/files/usr/bin/python';
|
|
18
|
+
if (fs.existsSync(termuxBinAlt)) {
|
|
19
|
+
return termuxBinAlt;
|
|
20
|
+
}
|
|
21
|
+
const candidates = ['python3', 'python'];
|
|
22
|
+
for (const cmd of candidates) {
|
|
23
|
+
try {
|
|
24
|
+
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
|
|
25
|
+
const res = execSync(checkCmd, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
26
|
+
if (res) return cmd;
|
|
27
|
+
} catch (_) {}
|
|
28
|
+
}
|
|
29
|
+
return 'python3';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const pythonBin = findPython();
|
|
33
|
+
const args = ['-m', 'termux_stt.platform.installer', ...process.argv.slice(2)];
|
|
34
|
+
|
|
35
|
+
const child = spawn(pythonBin, args, {
|
|
36
|
+
stdio: 'inherit',
|
|
37
|
+
env: process.env
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('error', (err) => {
|
|
41
|
+
console.error(`[${'termux_stt'}] Failed to spawn python process (${pythonBin}):`, err.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on('exit', (code, signal) => {
|
|
46
|
+
if (signal) {
|
|
47
|
+
process.kill(process.pid, signal);
|
|
48
|
+
} else {
|
|
49
|
+
process.exit(code || 0);
|
|
50
|
+
}
|
|
51
|
+
});
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "termux-stt",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "On-device Speech-to-Text & speaker diarization framework utilizing device resources for Android Termux",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"termux-stt": "bin/cli.js",
|
|
9
|
-
"termux-stt-install": "bin/termux-stt.js"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"index.js",
|
|
13
|
-
"index.d.ts",
|
|
14
|
-
"lib",
|
|
15
|
-
"bin",
|
|
16
|
-
"README.md",
|
|
17
|
-
"LICENSE"
|
|
18
|
-
],
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/uno-km/termux-stt.git"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"termux",
|
|
25
|
-
"stt",
|
|
26
|
-
"speech-to-text",
|
|
27
|
-
"whisper",
|
|
28
|
-
"whisper-cpp",
|
|
29
|
-
"vosk",
|
|
30
|
-
"sherpa-onnx",
|
|
31
|
-
"diarization",
|
|
32
|
-
"speaker-diarization",
|
|
33
|
-
"voice-recognition",
|
|
34
|
-
"audio-transcription",
|
|
35
|
-
"on-device-ai",
|
|
36
|
-
"edge-ai",
|
|
37
|
-
"mobile-ai",
|
|
38
|
-
"vulkan",
|
|
39
|
-
"vulkan-compute",
|
|
40
|
-
"gpu-acceleration",
|
|
41
|
-
"real-time-factor",
|
|
42
|
-
"low-latency",
|
|
43
|
-
"arm64",
|
|
44
|
-
"android",
|
|
45
|
-
"snapdragon",
|
|
46
|
-
"adreno",
|
|
47
|
-
"exynos",
|
|
48
|
-
"arm-mali",
|
|
49
|
-
"zero-compilation",
|
|
50
|
-
"vad",
|
|
51
|
-
"voice-activity-detection",
|
|
52
|
-
"silero-vad",
|
|
53
|
-
"x-vector",
|
|
54
|
-
"k-means",
|
|
55
|
-
"clustering",
|
|
56
|
-
"srt-export",
|
|
57
|
-
"vtt-export",
|
|
58
|
-
"rttm",
|
|
59
|
-
"microphone-streaming",
|
|
60
|
-
"headless-audio",
|
|
61
|
-
"pulseaudio",
|
|
62
|
-
"offline-speech",
|
|
63
|
-
"privacy-first",
|
|
64
|
-
"termux-aichain",
|
|
65
|
-
"termux-tts",
|
|
66
|
-
"termux-llamacpp",
|
|
67
|
-
"termux-diffusion",
|
|
68
|
-
"ameva-runtime",
|
|
69
|
-
"ggml",
|
|
70
|
-
"quantization",
|
|
71
|
-
"bionic-libc",
|
|
72
|
-
"autonomous-agents",
|
|
73
|
-
"voice-assistant"
|
|
74
|
-
],
|
|
75
|
-
"author": "uno-km (AMEVA Foundation) <dev@ameva.org>",
|
|
76
|
-
"license": "MIT",
|
|
77
|
-
"bugs": {
|
|
78
|
-
"url": "https://github.com/uno-km/termux-stt/issues"
|
|
79
|
-
},
|
|
80
|
-
"homepage": "https://uno-km.github.io/termux-stt/",
|
|
81
|
-
"dependencies": {
|
|
82
|
-
"@ameva/runtime": ">=2.0.0"
|
|
83
|
-
},
|
|
84
|
-
"engines": {
|
|
85
|
-
"node": ">=16.0.0"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "termux-stt",
|
|
3
|
+
"version": "1.2.12",
|
|
4
|
+
"description": "On-device Speech-to-Text & speaker diarization framework utilizing device resources for Android Termux",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"termux-stt": "bin/cli.js",
|
|
9
|
+
"termux-stt-install": "bin/termux-stt.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.d.ts",
|
|
14
|
+
"lib",
|
|
15
|
+
"bin",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/uno-km/termux-stt.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"termux",
|
|
25
|
+
"stt",
|
|
26
|
+
"speech-to-text",
|
|
27
|
+
"whisper",
|
|
28
|
+
"whisper-cpp",
|
|
29
|
+
"vosk",
|
|
30
|
+
"sherpa-onnx",
|
|
31
|
+
"diarization",
|
|
32
|
+
"speaker-diarization",
|
|
33
|
+
"voice-recognition",
|
|
34
|
+
"audio-transcription",
|
|
35
|
+
"on-device-ai",
|
|
36
|
+
"edge-ai",
|
|
37
|
+
"mobile-ai",
|
|
38
|
+
"vulkan",
|
|
39
|
+
"vulkan-compute",
|
|
40
|
+
"gpu-acceleration",
|
|
41
|
+
"real-time-factor",
|
|
42
|
+
"low-latency",
|
|
43
|
+
"arm64",
|
|
44
|
+
"android",
|
|
45
|
+
"snapdragon",
|
|
46
|
+
"adreno",
|
|
47
|
+
"exynos",
|
|
48
|
+
"arm-mali",
|
|
49
|
+
"zero-compilation",
|
|
50
|
+
"vad",
|
|
51
|
+
"voice-activity-detection",
|
|
52
|
+
"silero-vad",
|
|
53
|
+
"x-vector",
|
|
54
|
+
"k-means",
|
|
55
|
+
"clustering",
|
|
56
|
+
"srt-export",
|
|
57
|
+
"vtt-export",
|
|
58
|
+
"rttm",
|
|
59
|
+
"microphone-streaming",
|
|
60
|
+
"headless-audio",
|
|
61
|
+
"pulseaudio",
|
|
62
|
+
"offline-speech",
|
|
63
|
+
"privacy-first",
|
|
64
|
+
"termux-aichain",
|
|
65
|
+
"termux-tts",
|
|
66
|
+
"termux-llamacpp",
|
|
67
|
+
"termux-diffusion",
|
|
68
|
+
"ameva-runtime",
|
|
69
|
+
"ggml",
|
|
70
|
+
"quantization",
|
|
71
|
+
"bionic-libc",
|
|
72
|
+
"autonomous-agents",
|
|
73
|
+
"voice-assistant"
|
|
74
|
+
],
|
|
75
|
+
"author": "uno-km (AMEVA Foundation) <dev@ameva.org>",
|
|
76
|
+
"license": "MIT",
|
|
77
|
+
"bugs": {
|
|
78
|
+
"url": "https://github.com/uno-km/termux-stt/issues"
|
|
79
|
+
},
|
|
80
|
+
"homepage": "https://uno-km.github.io/termux-stt/",
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@ameva/runtime": ">=2.0.0"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=16.0.0"
|
|
86
|
+
}
|
|
87
|
+
}
|