Skip to content

Commit a743a44

Browse files
authored
Add on-device real-time ASR demo for HarmonyOS (#1606)
1 parent 91a43cc commit a743a44

Some content is hidden

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

55 files changed

+1341
-4
lines changed

harmony-os/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
VAD + Non-streaming ASR for speech recognition.
1111
Please see the doc at <https://k2-fsa.github.io/sherpa/onnx/harmony-os/vad-asr.html>
1212

13+
- [./SherpaOnnxStreamingAsr](./SherpaOnnxStreamingAsr) It shows how to use
14+
streaming ASR models for real-time on-device speech recognition.
15+
1316
- [./SherpaOnnxTts](./SherpaOnnxTts) It shows how to run on-device text-to-speech.
1417
Please see the doc at <https://k2-fsa.github.io/sherpa/onnx/harmony-os/tts.html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/node_modules
2+
/oh_modules
3+
/local.properties
4+
/.idea
5+
**/build
6+
/.hvigor
7+
.cxx
8+
/.clangd
9+
/.clang-format
10+
/.clang-tidy
11+
**/.test
12+
/.appanalyzer
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"app": {
3+
"bundleName": "com.k2fsa.sherpa.onnx.streaming.asr",
4+
"vendor": "example",
5+
"versionCode": 1000000,
6+
"versionName": "1.0.0",
7+
"icon": "$media:app_icon",
8+
"label": "$string:app_name"
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"string": [
3+
{
4+
"name": "app_name",
5+
"value": "SherpaOnnxStreamingAsr"
6+
}
7+
]
8+
}
2.71 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"app": {
3+
"signingConfigs": [],
4+
"products": [
5+
{
6+
"name": "default",
7+
"signingConfig": "default",
8+
"compatibleSdkVersion": "4.0.0(10)",
9+
"runtimeOS": "HarmonyOS",
10+
"buildOption": {
11+
"strictMode": {
12+
"caseSensitiveCheck": true,
13+
}
14+
}
15+
}
16+
],
17+
"buildModeSet": [
18+
{
19+
"name": "debug",
20+
},
21+
{
22+
"name": "release"
23+
}
24+
]
25+
},
26+
"modules": [
27+
{
28+
"name": "entry",
29+
"srcPath": "./entry",
30+
"targets": [
31+
{
32+
"name": "default",
33+
"applyToProducts": [
34+
"default"
35+
]
36+
}
37+
]
38+
}
39+
]
40+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"files": [
3+
"**/*.ets"
4+
],
5+
"ignore": [
6+
"**/src/ohosTest/**/*",
7+
"**/src/test/**/*",
8+
"**/src/mock/**/*",
9+
"**/node_modules/**/*",
10+
"**/oh_modules/**/*",
11+
"**/build/**/*",
12+
"**/.preview/**/*"
13+
],
14+
"ruleSet": [
15+
"plugin:@performance/recommended",
16+
"plugin:@typescript-eslint/recommended"
17+
],
18+
"rules": {
19+
}
20+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
/oh_modules
3+
/.preview
4+
/build
5+
/.cxx
6+
/.test
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"apiType": "stageMode",
3+
"buildOption": {
4+
"sourceOption": {
5+
"workers": [
6+
'./src/main/ets/workers/StreamingAsrWorker.ets'
7+
]
8+
}
9+
},
10+
"buildOptionSet": [
11+
{
12+
"name": "release",
13+
"arkOptions": {
14+
"obfuscation": {
15+
"ruleOptions": {
16+
"enable": false,
17+
"files": [
18+
"./obfuscation-rules.txt"
19+
]
20+
}
21+
}
22+
}
23+
},
24+
],
25+
"targets": [
26+
{
27+
"name": "default"
28+
},
29+
{
30+
"name": "ohosTest",
31+
}
32+
]
33+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
2+
3+
export default {
4+
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5+
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6+
}

0 commit comments

Comments
 (0)