From c9718aaf80a2895a36892d31b606fc2d580c0229 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Sun, 1 Dec 2024 21:46:26 +0800 Subject: [PATCH 01/10] Commit after creating the project --- harmony-os/SherpaOnnxTts/.gitignore | 12 ++++ harmony-os/SherpaOnnxTts/AppScope/app.json5 | 10 ++++ .../resources/base/element/string.json | 8 +++ .../resources/base/media/app_icon.png | Bin 0 -> 2777 bytes harmony-os/SherpaOnnxTts/build-profile.json5 | 40 ++++++++++++++ harmony-os/SherpaOnnxTts/code-linter.json5 | 20 +++++++ harmony-os/SherpaOnnxTts/entry/.gitignore | 6 ++ .../SherpaOnnxTts/entry/build-profile.json5 | 28 ++++++++++ harmony-os/SherpaOnnxTts/entry/hvigorfile.ts | 6 ++ .../SherpaOnnxTts/entry/obfuscation-rules.txt | 23 ++++++++ .../SherpaOnnxTts/entry/oh-package.json5 | 10 ++++ .../main/ets/entryability/EntryAbility.ets | 43 +++++++++++++++ .../entrybackupability/EntryBackupAbility.ets | 12 ++++ .../entry/src/main/ets/pages/Index.ets | 17 ++++++ .../SherpaOnnxTts/entry/src/main/module.json5 | 52 ++++++++++++++++++ .../main/resources/base/element/color.json | 8 +++ .../main/resources/base/element/string.json | 16 ++++++ .../main/resources/base/media/background.png | Bin 0 -> 57364 bytes .../main/resources/base/media/foreground.png | Bin 0 -> 12430 bytes .../resources/base/media/layered_image.json | 7 +++ .../main/resources/base/media/startIcon.png | Bin 0 -> 20093 bytes .../resources/base/profile/backup_config.json | 3 + .../resources/base/profile/main_pages.json | 5 ++ .../main/resources/en_US/element/string.json | 16 ++++++ .../main/resources/zh_CN/element/string.json | 16 ++++++ .../src/ohosTest/ets/test/Ability.test.ets | 35 ++++++++++++ .../entry/src/ohosTest/ets/test/List.test.ets | 5 ++ .../entry/src/ohosTest/module.json5 | 13 +++++ .../entry/src/test/List.test.ets | 5 ++ .../entry/src/test/LocalUnit.test.ets | 33 +++++++++++ .../SherpaOnnxTts/hvigor/hvigor-config.json5 | 22 ++++++++ harmony-os/SherpaOnnxTts/hvigorfile.ts | 6 ++ .../SherpaOnnxTts/oh-package-lock.json5 | 19 +++++++ harmony-os/SherpaOnnxTts/oh-package.json5 | 9 +++ 34 files changed, 505 insertions(+) create mode 100644 harmony-os/SherpaOnnxTts/.gitignore create mode 100644 harmony-os/SherpaOnnxTts/AppScope/app.json5 create mode 100644 harmony-os/SherpaOnnxTts/AppScope/resources/base/element/string.json create mode 100644 harmony-os/SherpaOnnxTts/AppScope/resources/base/media/app_icon.png create mode 100644 harmony-os/SherpaOnnxTts/build-profile.json5 create mode 100644 harmony-os/SherpaOnnxTts/code-linter.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/.gitignore create mode 100644 harmony-os/SherpaOnnxTts/entry/build-profile.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/hvigorfile.ts create mode 100644 harmony-os/SherpaOnnxTts/entry/obfuscation-rules.txt create mode 100644 harmony-os/SherpaOnnxTts/entry/oh-package.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/ets/entryability/EntryAbility.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/module.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/color.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/background.png create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/foreground.png create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/layered_image.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/startIcon.png create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/backup_config.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/main_pages.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json create mode 100644 harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/Ability.test.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/List.test.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/ohosTest/module.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/src/test/List.test.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/test/LocalUnit.test.ets create mode 100644 harmony-os/SherpaOnnxTts/hvigor/hvigor-config.json5 create mode 100644 harmony-os/SherpaOnnxTts/hvigorfile.ts create mode 100644 harmony-os/SherpaOnnxTts/oh-package-lock.json5 create mode 100644 harmony-os/SherpaOnnxTts/oh-package.json5 diff --git a/harmony-os/SherpaOnnxTts/.gitignore b/harmony-os/SherpaOnnxTts/.gitignore new file mode 100644 index 000000000..d2ff20141 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/AppScope/app.json5 b/harmony-os/SherpaOnnxTts/AppScope/app.json5 new file mode 100644 index 000000000..66d6bfd97 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.k2fsa.sherpa.onnx.tts", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/harmony-os/SherpaOnnxTts/AppScope/resources/base/element/string.json b/harmony-os/SherpaOnnxTts/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..2db317614 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "SherpaOnnxTts" + } + ] +} diff --git a/harmony-os/SherpaOnnxTts/AppScope/resources/base/media/app_icon.png b/harmony-os/SherpaOnnxTts/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 GIT binary patch literal 2777 zcmV;~3MTc5P)9*YHQQH znh@I(s7WDIN`nJ+5@|<)iZcg=qN74U#DNnD1Se7u4fs(|1ivr?9ayP|B3iYCD$mfQ zCQ{S1n2)}^yxe#1J=_0pt-a1UPwQ^Z*?X_`Uu*sM+8<}X+baE^a`3seUF}?bEaiMO zrD`Qrd5@qw^epHZ>Df|p-qKBUEB%*?!m0{PHC6j|RplEgR~PkM5a^}N)Sfwi>W;Uz zdhwo_4HXBU%kRl^w@&7iKPx$e-n9%#IU!&oMI~iNsw0n19qSX;dS>I`G_G=WdcN9r z;_Rtv9XC<7kbL+HHxJ782T~pg05t)tf^>2vNJqfYt{YmqQDoBxkv+ra*BxxhcuK2v zm5%@Y)biQz)R8O%e=o%n${;ojY;EUP>`Qj6Cq)7GHm)C%2%^+hI;Z4T#a|oKIvshv z5H%!I+|I4PEXaXj04%ybsVolr%vhKnW7AEhC?eP!o1{y;8m2R#;}{6VZPc!+)ou0C zVWz$|1#2(|L5z%EYRxOzP+uLB>qYGuajX-<#^u;Kw&2uh&93)h>nHaFA%{&2PW=Nn zr?*a;gk3xvRhQIRa1de-!r(ss&?tRmZ=L2FMkhxI3lK6Jn<>5c*ID|@KU#^MCIo6> zpFA{|R(4fsBwHIW z9v!7G|7enadv4}~*8q_h%tD^j$7=PCnn0=dR0GKA(fgb9`2IRg6ksBIo+Gdw#|-3eSe=3tmDe zIqVN)tScM`0W#Z>2wc>~2Uv=3L)~D4gXqZtPQ8rifbYJqwkG>bv}95G7+};9Br?hF zWSa3b)X}z#79W9kukM%6-b_54WDJm~Ub=gsrJ0lz-8&lrQ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x?(*3@YmdmWGAd%0QvXzS zJ53JpX%Fp!=>v&`Hd7F@+Atw2vx9%^2M-APg0Jd|ePsRn3*B$#9Z5hCou4fo7W#SN z#}-@-N=##yQDh26pNzr9f*Q88krhI5@DHcf{dU-~PLSs}MvI4s1i|<=qxD~9`7>*~ znlw5lr$_6mTG4XbBNF_79BzvZ!TeIP)exdk3)kSHjYdW1P10ZJ_NCJSlrCuIU#gqw f88(SSw!Z%ZUzhC#9QlKF00000NkvXXu0mjfG$}gK literal 0 HcmV?d00001 diff --git a/harmony-os/SherpaOnnxTts/build-profile.json5 b/harmony-os/SherpaOnnxTts/build-profile.json5 new file mode 100644 index 000000000..8e63d9768 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/build-profile.json5 @@ -0,0 +1,40 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "4.0.0(10)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/code-linter.json5 b/harmony-os/SherpaOnnxTts/code-linter.json5 new file mode 100644 index 000000000..77b31b517 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/code-linter.json5 @@ -0,0 +1,20 @@ +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/.gitignore b/harmony-os/SherpaOnnxTts/entry/.gitignore new file mode 100644 index 000000000..e2713a277 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/build-profile.json5 b/harmony-os/SherpaOnnxTts/entry/build-profile.json5 new file mode 100644 index 000000000..4d611879c --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/hvigorfile.ts b/harmony-os/SherpaOnnxTts/entry/hvigorfile.ts new file mode 100644 index 000000000..c6edcd904 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/harmony-os/SherpaOnnxTts/entry/obfuscation-rules.txt b/harmony-os/SherpaOnnxTts/entry/obfuscation-rules.txt new file mode 100644 index 000000000..272efb6ca --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 new file mode 100644 index 000000000..248c3b754 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/entryability/EntryAbility.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 000000000..679d91453 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,43 @@ +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import hilog from '@ohos.hilog'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import Want from '@ohos.app.ability.Want'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 000000000..d2c48b421 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import hilog from '@ohos.hilog'; +import BackupExtensionAbility, { BundleVersion } from '@ohos.application.BackupExtensionAbility'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets new file mode 100644 index 000000000..423b4276e --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,17 @@ +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/module.json5 b/harmony-os/SherpaOnnxTts/entry/src/main/module.json5 new file mode 100644 index 000000000..a1cea8b6a --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ], + } + ] + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/color.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/color.json new file mode 100644 index 000000000..3c712962d --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..f94595515 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/background.png b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602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Mx`by5{s2fgqV%IN2u``G2{;S#} z7(C_JHL#g4!TVKzH-;cqyTWYUbYJYD51;o&OW{neeF^8u{&=>3MOrA~?FdpJV zSYd`@e7yIF=r>t}q62JMgr{OifCEZ+OqL@U0qnPCM~vzAVAWSinbTGsoAj%8aAv*o zuWD3^SdZJGJp`)nD#ZmjSqj)I^?gr($f>AJ$#J))lJ(;mu}!}FFX04CDff;uyZT$@ z44yzaWcc(;REg2B-keS7+|){0hao1Ky6u~P!(lZL$EGcIp3i^I>#mUn%_C6l5a^P! z>!#Rsp#cEt6KG$x)xQV)s9bQ9Udl5Q!j2ysPa78L&HdLqdHuyUL@dr}NJnn_or0#u z)ho3h3FLS-gf8mRizhfvtzM0;@IyPk-^a6h9oP}I+0o=6~N{Rb6BX3y4 z5iV4cW^ZW|en}IQMT+TnetP+OC=>YD9ENf2e>0Cg{8J!oHPOl6dW}=^aM*Unss)1+rbRF+Sba7% zS^dsY{r8^f?G9m8-(u)oUlX_hU>wvBfuHDZcJ$scFzxx_sGe>&>$_MnNuJCsS&yi* z?S#{Ys<=ZKzX4zFL(&!$TFy;eGq<}lHtC1pKHZ{AsJ|Suh|q}G&Hj5`YQ6kg>-TLH z@Kyi8(;^duC=6+%3mPF4l)6`@ir!|39??Zz7I ztV%vhgYW=#7VO2Wemv>Gq}*g@;q;+w3>`V;kYxK;6FPKtq`3YYe^ONz(}&E_>Aq4d zi=*$Z4@FD3K~IDg#yC21E&p50#uK=4t=!6S^zF}6jtF|OY2C#@@z}oC8anXk#M0LC zd+<`)JID$k59QE^GI&PGf^LN=Mk)-?G zAp#plve>m9P|9#iZEcyjfDFB2Y_A!F^9a*j3Pm!I-(LKYNI0 A4*&oF literal 0 HcmV?d00001 diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/foreground.png b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 GIT binary patch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ZS6N0LGw(w2!|y(vgZ*y#F}>^b>-1db)Nj=f;xC|Ft8@YI zMIq1nn~#0+?)d1{!hey9e+8a5izk@{Oplez2GHqrSUlSN&@^wrvVyP!giSlmuO%9r zW`jOGD83?gYTjdlCEZT%G_f_YKb`yp!)N?Qcc8y6-5c~LFW-9YpKRX@b^v?Vs?#fW z*DlT`JnOH$|Jl3C_q|fP=kqnu&(d`7^YSrkS5(VraZMu&zIv_2t3qXyto_-1d=_pk z^vbJk!~$p|XLVszAW2V_Pv+Y=r{jaEb~--#@C&o@YkYyT{(x!uak=@SdyXFer}KN5 zFTlMk$hvZOMZ0@2f4q3@#*LTjFKs?eK|fUioJEMtmjUO-<02&yOE|p|V-%X=6Xv@X(oCxjr1jf2;npdQ$tQM<2QW z=azp~pZ|S`@O0`r&8O4l#eLPLy7n@?{`u15<>(>(HP?sj)ax^gp0C0^Q@=iWK*f2c zD)fL#sXs~F-K&MVM;neWi6M8@tERwteOT%%cv{JMqtu2a&-F?ld~arKwAH@y=LKKw z#h-2EA?L&VSjQ(K-_mq$Dl8u&b4}hKRXUGo8jtD{dqj15STlZy(C<7sI)2CQ_~fnE k9@EG3{4s5ok?kb>|H;3ubeVRY^#A|>07*qoM6N<$f~C=$asU7T literal 0 HcmV?d00001 diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/backup_config.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 000000000..78f40ae7c --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/main_pages.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..1898d94f5 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 000000000..f94595515 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 000000000..597ecf95e --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/Ability.test.ets b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 000000000..8aa374977 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,35 @@ +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + }) +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/List.test.ets b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 000000000..794c7dc4e --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/ohosTest/module.json5 b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/module.json5 new file mode 100644 index 000000000..55725a929 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/ohosTest/module.json5 @@ -0,0 +1,13 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false + } +} diff --git a/harmony-os/SherpaOnnxTts/entry/src/test/List.test.ets b/harmony-os/SherpaOnnxTts/entry/src/test/List.test.ets new file mode 100644 index 000000000..bb5b5c373 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/test/List.test.ets @@ -0,0 +1,5 @@ +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/test/LocalUnit.test.ets b/harmony-os/SherpaOnnxTts/entry/src/test/LocalUnit.test.ets new file mode 100644 index 000000000..165fc1615 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/test/LocalUnit.test.ets @@ -0,0 +1,33 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/hvigor/hvigor-config.json5 b/harmony-os/SherpaOnnxTts/hvigor/hvigor-config.json5 new file mode 100644 index 000000000..06b278367 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/harmony-os/SherpaOnnxTts/hvigorfile.ts b/harmony-os/SherpaOnnxTts/hvigorfile.ts new file mode 100644 index 000000000..f3cb9f1a8 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/hvigorfile.ts @@ -0,0 +1,6 @@ +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/harmony-os/SherpaOnnxTts/oh-package-lock.json5 b/harmony-os/SherpaOnnxTts/oh-package-lock.json5 new file mode 100644 index 000000000..f538ae290 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/oh-package-lock.json5 @@ -0,0 +1,19 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/oh-package.json5 b/harmony-os/SherpaOnnxTts/oh-package.json5 new file mode 100644 index 000000000..a79d5300e --- /dev/null +++ b/harmony-os/SherpaOnnxTts/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19" + } +} From a33e277214a1add92f66b978f22ab109c01bcd8a Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 2 Dec 2024 10:41:22 +0800 Subject: [PATCH 02/10] add more code --- harmony-os/.gitignore | 1 + .../SherpaOnnxHar/sherpa_onnx/Index.ets | 6 +- .../sherpa_onnx/src/main/cpp/CMakeLists.txt | 1 + .../main/cpp/sherpa-onnx-node-addon-api.cc | 12 + .../main/cpp/types/libsherpa_onnx/Index.d.ts | 2 + .../sherpa_onnx/src/main/cpp/utils.cc | 77 ++++++ harmony-os/SherpaOnnxTts/AppScope/app.json5 | 2 +- .../SherpaOnnxTts/entry/build-profile.json5 | 5 + .../SherpaOnnxTts/entry/oh-package-lock.json5 | 28 +++ .../SherpaOnnxTts/entry/oh-package.json5 | 5 +- .../entry/src/main/ets/pages/Index.ets | 31 +++ .../ets/workers/NonStreamingTtsWorker.ets | 230 ++++++++++++++++++ .../main/resources/base/element/string.json | 2 +- .../entry/src/main/resources/rawfile/.gitkeep | 0 14 files changed, 398 insertions(+), 4 deletions(-) create mode 100644 harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc create mode 100644 harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/rawfile/.gitkeep diff --git a/harmony-os/.gitignore b/harmony-os/.gitignore index ddb010f66..dd2f4066e 100644 --- a/harmony-os/.gitignore +++ b/harmony-os/.gitignore @@ -1 +1,2 @@ !build-profile.json5 +*.har diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/Index.ets b/harmony-os/SherpaOnnxHar/sherpa_onnx/Index.ets index 959b6ba02..14dff071e 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/Index.ets +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/Index.ets @@ -1,4 +1,8 @@ -export { readWave, readWaveFromBinary } from "libsherpa_onnx.so"; +export { + listRawfileDir, + readWave, + readWaveFromBinary, +} from "libsherpa_onnx.so"; export { CircularBuffer, diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt index e131b21da..95fd31531 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt @@ -46,6 +46,7 @@ add_library(sherpa_onnx SHARED speaker-identification.cc spoken-language-identification.cc streaming-asr.cc + utils.cc vad.cc wave-reader.cc wave-writer.cc diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc index 3f0affd79..54f0350fe 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc @@ -27,6 +27,10 @@ void InitKeywordSpotting(Napi::Env env, Napi::Object exports); void InitNonStreamingSpeakerDiarization(Napi::Env env, Napi::Object exports); +#if __OHOS__ +void InitUtils(Napi::Env env, Napi::Object exports); +#endif + Napi::Object Init(Napi::Env env, Napi::Object exports) { InitStreamingAsr(env, exports); InitNonStreamingAsr(env, exports); @@ -41,7 +45,15 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { InitKeywordSpotting(env, exports); InitNonStreamingSpeakerDiarization(env, exports); +#if __OHOS__ + InitUtils(env, exports); +#endif + return exports; } +#if __OHOS__ +NODE_API_MODULE(sherpa_onnx, Init) +#else NODE_API_MODULE(addon, Init) +#endif diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts index f44ade356..1fa304099 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts @@ -1,3 +1,5 @@ +export const listRawfileDir: (mgr: object, dir: string) => Array; + export const readWave: (filename: string, enableExternalBuffer: boolean = true) => {samples: Float32Array, sampleRate: number}; export const readWaveFromBinary: (data: Uint8Array, enableExternalBuffer: boolean = true) => {samples: Float32Array, sampleRate: number}; export const createCircularBuffer: (capacity: number) => object; diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc new file mode 100644 index 000000000..250238cbd --- /dev/null +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc @@ -0,0 +1,77 @@ +// Copyright (c) 2024 Xiaomi Corporation + +#include +#include +#include +#include + +#include "napi.h" // NOLINT +#include "rawfile/raw_file_manager.h" + +static std::vector GetFilenames(NativeResourceManager* mgr, const std::string& d, bool is_top = true) { + // OH_LOG_INFO(LOG_APP, "getting %{public}s", d.c_str()); + std::unique_ptr< RawDir, decltype(&OH_ResourceManager_CloseRawDir)> raw_dir (OH_ResourceManager_OpenRawDir(mgr, d.c_str()), &OH_ResourceManager_CloseRawDir); + int count = OH_ResourceManager_GetRawFileCount(raw_dir.get()); + std::vector ans; + ans.reserve(count); + for (int32_t i = 0; i < count; ++i) { + std::string filename = OH_ResourceManager_GetRawFileName(raw_dir.get(), i); + // OH_LOG_INFO(LOG_APP, "f: %{public}s %{public}s",d.c_str(), filename.c_str()); + bool is_dir = OH_ResourceManager_IsRawDir(mgr, d.empty() ? filename.c_str(): (d+ "/" + filename).c_str()); + if (is_dir) { + //OH_LOG_INFO(LOG_APP, " - is dir"); + + auto files = GetFilenames(mgr, d.empty() ? filename : d + "/" + filename, false); + for (const auto& f: files) { + ans.push_back(filename + "/" + f); + } + } else { + ans.push_back(std::move(filename)); + } + } + + if (is_top && !d.empty()) { + for (auto& f: ans) { + f = d + "/" + f; + } + } + return ans; +} + +static Napi::Array ListRawFileDir(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); + + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + + return {}; + } + + std::unique_ptr + mgr(OH_ResourceManager_InitNativeResourceManager(env, info[0]), + &OH_ResourceManager_ReleaseNativeResourceManager); + + if (!info[1].IsString()) { + Napi::TypeError::New(env, "Argument 1 should be a string") + .ThrowAsJavaScriptException(); + + return {}; + } + + std::string dir = info[1].As().Utf8Value(); + + auto files = GetFilenames(mgr.get(), dir); + Napi::Array ans = Napi::Array::New(env, files.size()); + for (int32_t i = 0; i != files.size(); ++i) { + ans[i] = Napi::String::New(env, files[i]); + } + return ans; +} +void InitUtils(Napi::Env env, Napi::Object exports) { + exports.Set(Napi::String::New(env, "listRawfileDir"), + Napi::Function::New(env, ListRawFileDir)); +} diff --git a/harmony-os/SherpaOnnxTts/AppScope/app.json5 b/harmony-os/SherpaOnnxTts/AppScope/app.json5 index 66d6bfd97..e5d0228ac 100644 --- a/harmony-os/SherpaOnnxTts/AppScope/app.json5 +++ b/harmony-os/SherpaOnnxTts/AppScope/app.json5 @@ -1,7 +1,7 @@ { "app": { "bundleName": "com.k2fsa.sherpa.onnx.tts", - "vendor": "example", + "vendor": "next-gen Kaldi", "versionCode": 1000000, "versionName": "1.0.0", "icon": "$media:app_icon", diff --git a/harmony-os/SherpaOnnxTts/entry/build-profile.json5 b/harmony-os/SherpaOnnxTts/entry/build-profile.json5 index 4d611879c..554d19f3b 100644 --- a/harmony-os/SherpaOnnxTts/entry/build-profile.json5 +++ b/harmony-os/SherpaOnnxTts/entry/build-profile.json5 @@ -1,6 +1,11 @@ { "apiType": "stageMode", "buildOption": { + "sourceOption": { + "workers": [ + "./src/main/ets/workers/NonStreamingTtsWorker.ets" + ] + } }, "buildOptionSet": [ { diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 new file mode 100644 index 000000000..f5bb9eee6 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 @@ -0,0 +1,28 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "sherpa_onnx@sherpa_onnx.har": "sherpa_onnx@sherpa_onnx.har" + }, + "packages": { + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": { + "name": "libsherpa_onnx.so", + "version": "1.0.0", + "resolved": "../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "registryType": "local" + }, + "sherpa_onnx@sherpa_onnx.har": { + "name": "sherpa_onnx", + "version": "1.10.32", + "resolved": "sherpa_onnx.har", + "registryType": "local", + "dependencies": { + "libsherpa_onnx.so": "file:./src/main/cpp/types/libsherpa_onnx" + } + } + } +} \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 index 248c3b754..cdcb3953a 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 @@ -5,6 +5,9 @@ "main": "", "author": "", "license": "", - "dependencies": {} + "dependencies": { + // "sherpa_onnx": "1.10.32", + "sherpa_onnx": "file:./sherpa_onnx.har" + } } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 423b4276e..956966fd7 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -1,14 +1,45 @@ +import { listRawfileDir } from 'sherpa_onnx'; +import worker, { MessageEvents } from '@ohos.worker'; + + @Entry @Component struct Index { @State message: string = 'Hello World'; + private workerInstance?: worker.ThreadWorker + private readonly scriptURL: string = 'entry/ets/workers/NonStreamingTtsWorker.ets' + + aboutToAppear() { + this.workerInstance = new worker.ThreadWorker(this.scriptURL, { + name: 'NonStreaming TTS worker' + }); + this.workerInstance.onmessage = (e: MessageEvents) => { + const msgType = e.data['msgType'] as string; + console.log(`received msg from worker: ${msgType}`); + + if (msgType == 'init-tts-done') { + console.log('init tts done'); + } + } + + this.workerInstance.postMessage({ msgType: 'init-tts', context: getContext() }); + } + build() { Row() { Column() { Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) + .onClick(()=>{ + console.log("clicked"); + const mgr = getContext().resourceManager; + const files: string[] = listRawfileDir(mgr, ""); + for (const f of files) { + console.log(f); + } + }) } .width('100%') } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets new file mode 100644 index 000000000..1a869cdd9 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -0,0 +1,230 @@ +import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@ohos.worker'; + +import { fileIo as fs } from '@kit.CoreFileKit'; + +import {OfflineTtsConfig, OfflineTts, listRawfileDir} from 'sherpa_onnx'; +import { buffer } from '@kit.ArkTS'; + +const workerPort: ThreadWorkerGlobalScope = worker.workerPort; + +let tts: OfflineTts; + +function mkdir(context: Context, parts: string[]) { + const path = parts.join('/'); + if (fs.accessSync(path)) { + return; + } + + const sandboxPath: string = context.getApplicationContext().filesDir; + let d = sandboxPath + for (const p of parts) { + d = d + '/' + p; + + if (fs.accessSync(d)) { + continue; + } + + fs.mkdirSync(d); + console.log(`created dir: ${d}`); + } +} + +function copyRawFileDirToSandbox(context: Context, srcDir: string) { + let mgr = context.resourceManager; + const allFiles: string[] = listRawfileDir(mgr, srcDir); + console.log(allFiles.join('\n')); + for (const src of allFiles) { + const parts: string[] = src.split('/'); + if (parts.length != 1) { + mkdir(context, parts.slice(0, -1)); + } + + copyRawFileToSandbox(context, src, src); + } +} + +function copyRawFileToSandbox(context: Context, src: string, dst: string) { + console.log(`copying ${src} to ${dst}`); + // see https://blog.csdn.net/weixin_44640245/article/details/142634846 + // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/rawfile-guidelines-V5 + let uint8Array: Uint8Array = context.resourceManager.getRawFileContentSync(src); + + // https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-file-fs-V5#fsmkdir + let sandboxPath: string = context.getApplicationContext().filesDir; + let filepath = sandboxPath + '/' + dst; + + if (fs.accessSync(filepath)) { + // if the destination exists and has the expected file size, + // then we skip copying it + let stat = fs.statSync(filepath); + if (stat.size == uint8Array.length) { + return; + } + } + + const fp = fs.openSync(filepath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE | fs.OpenMode.TRUNC); + fs.writeSync(fp.fd, buffer.from(uint8Array).buffer) + fs.close(fp.fd); +} + +function initTts(context: Context): OfflineTts { + // Such a design is to make it easier to build flutter APPs with + // github actions for a variety of tts models + // + // See https://github.com/k2-fsa/sherpa-onnx/blob/master/scripts/flutter/generate-tts.py + // for details + + let modelDir = ''; + let modelName = ''; + let ruleFsts = ''; + let ruleFars = ''; + let lexicon = ''; + let dataDir = ''; + let dictDir = ''; + // You can select an example below and change it according to match your + // selected tts model + + // ============================================================ + // Your change starts here + // ============================================================ + + // Example 1: + // modelDir = 'vits-vctk'; + // modelName = 'vits-vctk.onnx'; + // lexicon = 'lexicon.txt'; + + // Example 2: + // https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models + // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 + modelDir = 'vits-piper-en_US-amy-low'; + modelName = 'en_US-amy-low.onnx'; + dataDir = 'espeak-ng-data'; + + // Example 3: + // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2 + // modelDir = 'vits-icefall-zh-aishell3'; + // modelName = 'model.onnx'; + // ruleFsts = 'vits-icefall-zh-aishell3/phone.fst,vits-icefall-zh-aishell3/date.fst,vits-icefall-zh-aishell3/number.fst,vits-icefall-zh-aishell3/new_heteronym.fst'; + // ruleFars = 'vits-icefall-zh-aishell3/rule.far'; + // lexicon = 'lexicon.txt'; + + // Example 4: + // https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#csukuangfj-vits-zh-hf-fanchen-c-chinese-187-speakers + // modelDir = 'vits-zh-hf-fanchen-C'; + // modelName = 'vits-zh-hf-fanchen-C.onnx'; + // lexicon = 'lexicon.txt'; + // dictDir = 'vits-zh-hf-fanchen-C/dict'; + + // Example 5: + // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-coqui-de-css10.tar.bz2 + // modelDir = 'vits-coqui-de-css10'; + // modelName = 'model.onnx'; + + // Example 6 + // https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models + // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-libritts_r-medium.tar.bz2 + // modelDir = 'vits-piper-en_US-libritts_r-medium'; + // modelName = 'en_US-libritts_r-medium.onnx'; + // dataDir = 'espeak-ng-data'; + + // Example 7 + // https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models + // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-melo-tts-zh_en.tar.bz2 + // modelDir = 'vits-melo-tts-zh_en'; + // modelName = 'model.onnx'; + // lexicon = 'lexicon.txt'; + // dictDir = 'vits-melo-tts-zh_en/dict'; + + // ============================================================ + // Please don't change the remaining part of this function + // ============================================================ + + if (modelName == '') { + throw new Error('You are supposed to select a model by changing the code before you run the app'); + } + + modelName = modelDir + '/' + modelName; + + if (ruleFsts != '') { + let fsts = ruleFsts.split(',') + let tmp: string[] = []; + for (const f of fsts) { + tmp.push(modelDir + '/' + f); + } + ruleFsts = tmp.join(','); + } + + if (ruleFars != '') { + let fars = ruleFars.split(',') + let tmp: string[] = []; + for (const f of fars) { + tmp.push(modelDir + '/' + f); + } + ruleFars = tmp.join(','); + } + + if (lexicon != '') { + lexicon = modelDir + '/' + lexicon; + } + + if (dataDir != '') { + copyRawFileDirToSandbox(context, modelDir + '/' + dataDir) + let sandboxPath: string = context.getApplicationContext().filesDir; + dataDir = sandboxPath + '/' + modelDir + '/' + dataDir; + } + + if (dictDir != '') { + copyRawFileDirToSandbox(context, modelDir + '/' + dictDir) + let sandboxPath: string = context.getApplicationContext().filesDir; + dictDir = sandboxPath + '/' + modelDir + '/' + dictDir; + } + + const tokens = modelDir + '/tokens.txt'; + + const config: OfflineTtsConfig = new OfflineTtsConfig(); + config.model.vits.model = modelName; + config.model.vits.lexicon = lexicon; + config.model.vits.tokens = tokens; + config.model.vits.dataDir = dataDir; + config.model.vits.dictDir = dictDir; + config.model.numThreads = 2; + config.model.debug = true; + config.ruleFsts = ruleFsts; + config.ruleFars = ruleFars; + + return new OfflineTts(config, context.resourceManager); +} + +/** + * Defines the event handler to be called when the worker thread receives a message sent by the host thread. + * The event handler is executed in the worker thread. + * + * @param e message data + */ +workerPort.onmessage = (e: MessageEvents) => { + const msgType = e.data['msgType'] as string; + console.log(`msg-type: ${msgType}`); + if (msgType == 'init-tts' && !tts) { + const context = e.data['context'] as Context; + workerPort.postMessage({ 'msgType': 'init-tts-done' }); + tts = initTts(context); + } +} + +/** + * Defines the event handler to be called when the worker receives a message that cannot be deserialized. + * The event handler is executed in the worker thread. + * + * @param e message data + */ +workerPort.onmessageerror = (e: MessageEvents) => { +} + +/** + * Defines the event handler to be called when an exception occurs during worker execution. + * The event handler is executed in the worker thread. + * + * @param e error message + */ +workerPort.onerror = (e: ErrorEvent) => { +} diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json index f94595515..c7648b51e 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json @@ -10,7 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "label" + "value": "TTS" } ] } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/rawfile/.gitkeep b/harmony-os/SherpaOnnxTts/entry/src/main/resources/rawfile/.gitkeep new file mode 100644 index 000000000..e69de29bb From 30ca97d9355ebfbc9971f8fd9df0ff0edca65b36 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 2 Dec 2024 12:29:49 +0800 Subject: [PATCH 03/10] First working version --- .../sherpa_onnx/src/main/cpp/utils.cc | 55 +++++---- .../SherpaOnnxTts/entry/oh-package-lock.json5 | 12 +- .../SherpaOnnxTts/entry/oh-package.json5 | 2 +- .../entry/src/main/ets/pages/Index.ets | 105 +++++++++++++++++- .../ets/workers/NonStreamingTtsWorker.ets | 27 ++++- sherpa-onnx/csrc/lexicon.cc | 47 +++++--- sherpa-onnx/csrc/offline-tts-vits-impl.h | 27 +++++ sherpa-onnx/csrc/offline-tts-vits-model.cc | 4 + 8 files changed, 220 insertions(+), 59 deletions(-) diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc index 250238cbd..79e2442b8 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc @@ -5,37 +5,36 @@ #include #include +#include "macros.h" #include "napi.h" // NOLINT -#include "rawfile/raw_file_manager.h" -static std::vector GetFilenames(NativeResourceManager* mgr, const std::string& d, bool is_top = true) { - // OH_LOG_INFO(LOG_APP, "getting %{public}s", d.c_str()); - std::unique_ptr< RawDir, decltype(&OH_ResourceManager_CloseRawDir)> raw_dir (OH_ResourceManager_OpenRawDir(mgr, d.c_str()), &OH_ResourceManager_CloseRawDir); - int count = OH_ResourceManager_GetRawFileCount(raw_dir.get()); - std::vector ans; - ans.reserve(count); - for (int32_t i = 0; i < count; ++i) { - std::string filename = OH_ResourceManager_GetRawFileName(raw_dir.get(), i); - // OH_LOG_INFO(LOG_APP, "f: %{public}s %{public}s",d.c_str(), filename.c_str()); - bool is_dir = OH_ResourceManager_IsRawDir(mgr, d.empty() ? filename.c_str(): (d+ "/" + filename).c_str()); - if (is_dir) { - //OH_LOG_INFO(LOG_APP, " - is dir"); - - auto files = GetFilenames(mgr, d.empty() ? filename : d + "/" + filename, false); - for (const auto& f: files) { - ans.push_back(filename + "/" + f); - } - } else { - ans.push_back(std::move(filename)); - } +static std::vector GetFilenames(NativeResourceManager *mgr, + const std::string &d) { + std::unique_ptr raw_dir( + OH_ResourceManager_OpenRawDir(mgr, d.c_str()), + &OH_ResourceManager_CloseRawDir); + int count = OH_ResourceManager_GetRawFileCount(raw_dir.get()); + std::vector ans; + ans.reserve(count); + for (int32_t i = 0; i < count; ++i) { + std::string filename = OH_ResourceManager_GetRawFileName(raw_dir.get(), i); + bool is_dir = OH_ResourceManager_IsRawDir( + mgr, d.empty() ? filename.c_str() : (d + "/" + filename).c_str()); + if (is_dir) { + auto files = GetFilenames(mgr, d.empty() ? filename : d + "/" + filename); + for (auto &f : files) { + ans.push_back(std::move(f)); + } + } else { + if (d.empty()) { + ans.push_back(std::move(filename)); + } else { + ans.push_back(d + "/" + filename); + } } - - if (is_top && !d.empty()) { - for (auto& f: ans) { - f = d + "/" + f; - } - } - return ans; + } + + return ans; } static Napi::Array ListRawFileDir(const Napi::CallbackInfo &info) { diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 index f5bb9eee6..341f3c301 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 @@ -5,20 +5,20 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", - "sherpa_onnx@sherpa_onnx.har": "sherpa_onnx@sherpa_onnx.har" + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "sherpa_onnx@sherpa_onnx_4.har": "sherpa_onnx@sherpa_onnx_4.har" }, "packages": { - "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": { + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": { "name": "libsherpa_onnx.so", "version": "1.0.0", - "resolved": "../oh_modules/.ohpm/sherpa_onnx@9dtm7uueiwk84+1p45kjqgz4lhkmqjzwvjlaem2v+dq=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "resolved": "../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", "registryType": "local" }, - "sherpa_onnx@sherpa_onnx.har": { + "sherpa_onnx@sherpa_onnx_4.har": { "name": "sherpa_onnx", "version": "1.10.32", - "resolved": "sherpa_onnx.har", + "resolved": "sherpa_onnx_4.har", "registryType": "local", "dependencies": { "libsherpa_onnx.so": "file:./src/main/cpp/types/libsherpa_onnx" diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 index cdcb3953a..b7b421353 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 @@ -7,7 +7,7 @@ "license": "", "dependencies": { // "sherpa_onnx": "1.10.32", - "sherpa_onnx": "file:./sherpa_onnx.har" + "sherpa_onnx": "file:./sherpa_onnx_4.har" } } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 956966fd7..14e279315 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -1,15 +1,88 @@ -import { listRawfileDir } from 'sherpa_onnx'; +import { CircularBuffer } from 'sherpa_onnx'; import worker, { MessageEvents } from '@ohos.worker'; +import { audio } from '@kit.AudioKit'; + @Entry @Component struct Index { @State message: string = 'Hello World'; + @State initTtsDone: boolean = false; + @State ttsGeneratedDone: boolean = true; private workerInstance?: worker.ThreadWorker private readonly scriptURL: string = 'entry/ets/workers/NonStreamingTtsWorker.ets' + // it specifies only the initial capacity. + // note that circular buffer can automatically resize. + private sampleBuffer: CircularBuffer = new CircularBuffer(16000 * 5); + @State sampleRate: number = 0; + + private audioRenderer: audio.AudioRenderer | null = null; + @State initAudioDone: boolean = false; + + private audioPlayCallback = (buffer: ArrayBuffer) => { + const numSamples = buffer.byteLength / 2; + if (this.sampleBuffer.size() >= numSamples) { + const samples = this.sampleBuffer.get(this.sampleBuffer.head(), numSamples); + const int16Samples = new Int16Array(buffer); + for (let i = 0; i < numSamples; ++i) { + let s = samples[i] * 32767; + s = s > 32767 ? 32767 : s; + s = s < -32768 ? -32768 : s; + int16Samples[i] = s; + } + this.sampleBuffer.pop(numSamples); + } else { + (new Int16Array(buffer)).fill(0); + if (this.ttsGeneratedDone) { + this.audioRenderer?.stop(); + } + } + }; + + initAudioRenderer() { + if (this.audioRenderer) { + console.log(`Audio renderer has already been created. Skip creating`); + return; + } + // see + // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/using-audiorenderer-for-playback-V5 + const audioStreamInfo: audio.AudioStreamInfo = { + samplingRate: this.sampleRate, + channels: audio.AudioChannel.CHANNEL_1, // 通道 + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + }; + + const audioRendererInfo: audio.AudioRendererInfo = { + usage: audio.StreamUsage.STREAM_USAGE_MUSIC, + rendererFlags: 0 + }; + + const audioRendererOptions: audio.AudioRendererOptions = { + streamInfo: audioStreamInfo, + rendererInfo: audioRendererInfo + }; + + audio.createAudioRenderer(audioRendererOptions, (err, renderer) => { + if (!err) { + console.log('audio renderer initialized successfully'); + this.initAudioDone = true; + if (renderer) { + this.audioRenderer = renderer; + this.audioRenderer.on("writeData", this.audioPlayCallback); + if (this.sampleBuffer.size()) { + this.audioRenderer.start(); + } + } else { + console.log(`returned audio renderer is ${renderer}`); + } + } + }); + } + aboutToAppear() { this.workerInstance = new worker.ThreadWorker(this.scriptURL, { name: 'NonStreaming TTS worker' @@ -20,6 +93,25 @@ struct Index { if (msgType == 'init-tts-done') { console.log('init tts done'); + this.initTtsDone = true; + } + + if (msgType == 'tts-generate-done') { + const samples: Float32Array = e.data['samples'] as Float32Array; + const sampleRate = e.data['sampleRate'] as number; + if (this.sampleRate == 0) { + console.log(`sample rate is ${sampleRate}`); + this.sampleRate = sampleRate; + } + this.sampleBuffer.push(samples); + this.ttsGeneratedDone = true; + if (!this.initAudioDone) { + this.initAudioRenderer(); + } + + if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING) { + this.audioRenderer.start(); + } } } @@ -33,12 +125,13 @@ struct Index { .fontSize(50) .fontWeight(FontWeight.Bold) .onClick(()=>{ - console.log("clicked"); - const mgr = getContext().resourceManager; - const files: string[] = listRawfileDir(mgr, ""); - for (const f of files) { - console.log(f); + if (this.workerInstance && this.initTtsDone) { + const text = 'how are you doing?'; + console.log(`sending ${text}`) + this.ttsGeneratedDone = false; + this.workerInstance.postMessage({msgType: 'tts-generate', text}); } + }) } .width('100%') diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index 1a869cdd9..1c988e29b 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -2,7 +2,7 @@ import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@oho import { fileIo as fs } from '@kit.CoreFileKit'; -import {OfflineTtsConfig, OfflineTts, listRawfileDir} from 'sherpa_onnx'; +import {OfflineTtsConfig, OfflineTts, listRawfileDir, TtsInput, TtsOutput} from 'sherpa_onnx'; import { buffer } from '@kit.ArkTS'; const workerPort: ThreadWorkerGlobalScope = worker.workerPort; @@ -25,14 +25,12 @@ function mkdir(context: Context, parts: string[]) { } fs.mkdirSync(d); - console.log(`created dir: ${d}`); } } function copyRawFileDirToSandbox(context: Context, srcDir: string) { let mgr = context.resourceManager; const allFiles: string[] = listRawfileDir(mgr, srcDir); - console.log(allFiles.join('\n')); for (const src of allFiles) { const parts: string[] = src.split('/'); if (parts.length != 1) { @@ -44,7 +42,6 @@ function copyRawFileDirToSandbox(context: Context, srcDir: string) { } function copyRawFileToSandbox(context: Context, src: string, dst: string) { - console.log(`copying ${src} to ${dst}`); // see https://blog.csdn.net/weixin_44640245/article/details/142634846 // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/rawfile-guidelines-V5 let uint8Array: Uint8Array = context.resourceManager.getRawFileContentSync(src); @@ -209,6 +206,28 @@ workerPort.onmessage = (e: MessageEvents) => { workerPort.postMessage({ 'msgType': 'init-tts-done' }); tts = initTts(context); } + + if (msgType == 'tts-generate') { + const text = e.data['text'] as string; + console.log(`recevied text ${text}`); + const input: TtsInput = new TtsInput(); + input.text = text; + input.sid = 0; + input.speed = 1.0; + const ttsOutput: TtsOutput = tts.generate(input); + console.log(`sampleRate: ${ttsOutput.sampleRate}`); + console.log(`num samples: ${ttsOutput.samples.length}`); + + let sum = 0; + for (const s of ttsOutput.samples) { + sum += s; + } + console.log(`sum is ${sum}`); + workerPort.postMessage({ + 'msgType': 'tts-generate-done', + samples: Float32Array.from(ttsOutput.samples), + sampleRate: ttsOutput.sampleRate }); + } } /** diff --git a/sherpa-onnx/csrc/lexicon.cc b/sherpa-onnx/csrc/lexicon.cc index fe5e595b9..505ea37a8 100644 --- a/sherpa-onnx/csrc/lexicon.cc +++ b/sherpa-onnx/csrc/lexicon.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -159,17 +160,26 @@ std::vector Lexicon::ConvertTextToTokenIdsChinese( words = ProcessHeteronyms(words); if (debug_) { - fprintf(stderr, "Input text in string: %s\n", text.c_str()); - fprintf(stderr, "Input text in bytes:"); + std::ostringstream os; + + os << "Input text in string: " << text << "\n"; + os << "Input text in bytes:"; for (uint8_t c : text) { - fprintf(stderr, " %02x", c); + os << " 0x" << std::setfill('0') << std::setw(2) << std::right << std::hex + << c; } - fprintf(stderr, "\n"); - fprintf(stderr, "After splitting to words:"); + os << "\n"; + os << "After splitting to words:"; for (const auto &w : words) { - fprintf(stderr, " %s", w.c_str()); + os << " " << w; } - fprintf(stderr, "\n"); + os << "\n"; + +#if __OHOS__ + SHERPA_ONNX_LOGE("%{public}s", os.str().c_str()); +#else + SHERPA_ONNX_LOGE("%s", os.str().c_str()); +#endif } std::vector ans; @@ -259,17 +269,26 @@ std::vector Lexicon::ConvertTextToTokenIdsNotChinese( std::vector words = SplitUtf8(text); if (debug_) { - fprintf(stderr, "Input text (lowercase) in string: %s\n", text.c_str()); - fprintf(stderr, "Input text in bytes:"); + std::ostringstream os; + + os << "Input text (lowercase) in string: " << text << "\n"; + os << "Input text in bytes:"; for (uint8_t c : text) { - fprintf(stderr, " %02x", c); + os << " 0x" << std::setfill('0') << std::setw(2) << std::right << std::hex + << c; } - fprintf(stderr, "\n"); - fprintf(stderr, "After splitting to words:"); + os << "\n"; + os << "After splitting to words:"; for (const auto &w : words) { - fprintf(stderr, " %s", w.c_str()); + os << " " << w; } - fprintf(stderr, "\n"); + os << "\n"; + +#if __OHOS__ + SHERPA_ONNX_LOGE("%{public}s", os.str().c_str()); +#else + SHERPA_ONNX_LOGE("%s", os.str().c_str()); +#endif } int32_t blank = token2id_.at(" "); diff --git a/sherpa-onnx/csrc/offline-tts-vits-impl.h b/sherpa-onnx/csrc/offline-tts-vits-impl.h index 972303dd4..f86363d34 100644 --- a/sherpa-onnx/csrc/offline-tts-vits-impl.h +++ b/sherpa-onnx/csrc/offline-tts-vits-impl.h @@ -40,7 +40,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { tn_list_.reserve(files.size()); for (const auto &f : files) { if (config.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE("rule fst: %{public}s", f.c_str()); +#else SHERPA_ONNX_LOGE("rule fst: %s", f.c_str()); +#endif } tn_list_.push_back(std::make_unique(f)); } @@ -57,7 +61,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { for (const auto &f : files) { if (config.model.debug) { +#if __OHOS__ SHERPA_ONNX_LOGE("rule far: %s", f.c_str()); +#else + SHERPA_ONNX_LOGE("rule far: %{public}s", f.c_str()); +#endif } std::unique_ptr> reader( fst::FarReader::Open(f)); @@ -88,7 +96,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { tn_list_.reserve(files.size()); for (const auto &f : files) { if (config.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE("rule fst: %{public}s", f.c_str()); +#else SHERPA_ONNX_LOGE("rule fst: %s", f.c_str()); +#endif } auto buf = ReadFile(mgr, f); std::istrstream is(buf.data(), buf.size()); @@ -103,7 +115,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { for (const auto &f : files) { if (config.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE("rule far: %{public}s", f.c_str()); +#else SHERPA_ONNX_LOGE("rule far: %s", f.c_str()); +#endif } auto buf = ReadFile(mgr, f); @@ -156,7 +172,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { std::string text = _text; if (config_.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE("Raw text: %{public}s", text.c_str()); +#else SHERPA_ONNX_LOGE("Raw text: %s", text.c_str()); +#endif } if (!tn_list_.empty()) { @@ -226,10 +246,17 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { int32_t num_batches = x_size / batch_size; if (config_.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE( + "Text is too long. Split it into %{public}d batches. batch size: " + "%{public}d. Number of sentences: %{public}d", + num_batches, batch_size, x_size); +#else SHERPA_ONNX_LOGE( "Text is too long. Split it into %d batches. batch size: %d. Number " "of sentences: %d", num_batches, batch_size, x_size); +#endif } GeneratedAudio ans; diff --git a/sherpa-onnx/csrc/offline-tts-vits-model.cc b/sherpa-onnx/csrc/offline-tts-vits-model.cc index 38efc6204..eb605a7bd 100644 --- a/sherpa-onnx/csrc/offline-tts-vits-model.cc +++ b/sherpa-onnx/csrc/offline-tts-vits-model.cc @@ -144,7 +144,11 @@ class OfflineTtsVitsModel::Impl { ++i; } +#if __OHOS__ + SHERPA_ONNX_LOGE("%{public}s\n", os.str().c_str()); +#else SHERPA_ONNX_LOGE("%s\n", os.str().c_str()); +#endif } Ort::AllocatorWithDefaultOptions allocator; // used in the macro below From fecc662ca371bb38e293d3978975663032af854b Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 2 Dec 2024 18:27:16 +0800 Subject: [PATCH 04/10] Support calling js callback from C++. --- .../sherpa_onnx/build-profile.json5 | 2 +- .../sherpa_onnx/src/main/cpp/CMakeLists.txt | 4 + .../src/main/cpp/non-streaming-tts.cc | 37 ++- .../main/ets/components/NonStreamingTts.ets | 8 +- .../SherpaOnnxTts/entry/oh-package.json5 | 2 +- .../entry/src/main/ets/pages/Index.ets | 224 ++++++++++++++---- .../ets/workers/NonStreamingTtsWorker.ets | 14 +- 7 files changed, 233 insertions(+), 58 deletions(-) diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/build-profile.json5 b/harmony-os/SherpaOnnxHar/sherpa_onnx/build-profile.json5 index 8f789fb2a..905c57127 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/build-profile.json5 +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/build-profile.json5 @@ -4,7 +4,7 @@ "externalNativeOptions": { "path": "./src/main/cpp/CMakeLists.txt", "arguments": "", - "cppFlags": "", + "cppFlags": "-std=c++17", "abiFilters": [ "arm64-v8a", "x86_64", diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt index 95fd31531..26dda1789 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.13.0) project(myNpmLib) +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ version to use") +endif() + # Disable warning about # # "The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc index da70e662c..dfaac5c13 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc @@ -9,6 +9,12 @@ #include "napi.h" // NOLINT #include "sherpa-onnx/c-api/c-api.h" +/* +notes: + +(1) ThreadSafeFunction https://github.com/nodejs/node-addon-api/blob/main/doc/threadsafe_function.md +*/ + static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig( Napi::Object obj) { SherpaOnnxOfflineTtsVitsModelConfig c; @@ -218,7 +224,7 @@ static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { if (info.Length() != 2) { std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + os << "Expect only 2 arguments. Given: " << info.Length(); Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); @@ -297,9 +303,34 @@ static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { std::string text = _text.Utf8Value(); int32_t sid = obj.Get("sid").As().Int32Value(); float speed = obj.Get("speed").As().FloatValue(); + + const SherpaOnnxGeneratedAudio *audio; + if (obj.Has("callback") && obj.Get("callback").IsFunction()) { + Napi::Function cb = obj.Get("callback").As(); + struct MyCallbackArg { + Napi::Env* penv; + Napi::Function* pcb; + }; + + MyCallbackArg arg = {&env, &cb}; + + auto callback = [](const float* samples, int32_t n, void*arg)->int { + auto parg = reinterpret_cast(arg); + + Napi::Float32Array float32Array = + Napi::Float32Array::New(*parg->penv, n); + + std::copy(samples, samples + n, float32Array.Data()); + + parg->pcb->Call({float32Array}); + return 1; + }; + audio = SherpaOnnxOfflineTtsGenerateWithCallbackWithArg(tts, text.c_str(), sid, speed, callback, &arg); + } else { + audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); + } - const SherpaOnnxGeneratedAudio *audio = - SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); + if (enable_external_buffer) { Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets index c568b9990..5c7d86229 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets @@ -16,14 +16,14 @@ export class OfflineTtsVitsModelConfig { public lengthScale: number = 1.0; } -export class OfflineTtsModelConfig{ +export class OfflineTtsModelConfig { public vits: OfflineTtsVitsModelConfig = new OfflineTtsVitsModelConfig(); public numThreads: number = 1; public debug: boolean = false; public provider: string = 'cpu'; } -export class OfflineTtsConfig{ +export class OfflineTtsConfig { public model: OfflineTtsModelConfig = new OfflineTtsModelConfig(); public ruleFsts: string = ''; public ruleFars: string = ''; @@ -39,13 +39,15 @@ export class TtsInput { public text: string = ''; public sid: number = 0; public speed: number = 1.0; + public callback?: (samples: Float32Array) => number; } export class OfflineTts { - private handle: object; public config: OfflineTtsConfig; public numSpeakers: number; public sampleRate: number; + private handle: object; + constructor(config: OfflineTtsConfig, mgr?: object) { this.handle = createOfflineTts(config, mgr); this.config = config; diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 index b7b421353..be784ea24 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 @@ -7,7 +7,7 @@ "license": "", "dependencies": { // "sherpa_onnx": "1.10.32", - "sherpa_onnx": "file:./sherpa_onnx_4.har" + "sherpa_onnx": "file:./sherpa_onnx_9.har" } } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 14e279315..23fbdef1f 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -1,53 +1,84 @@ import { CircularBuffer } from 'sherpa_onnx'; import worker, { MessageEvents } from '@ohos.worker'; import { audio } from '@kit.AudioKit'; +import picker from '@ohos.file.picker'; +import fs from '@ohos.file.fs'; +import systemTime from '@ohos.systemTime'; +function savePcmToWav(filename: string, samples: Int16Array, sampleRate: number) { + const fp = fs.openSync(filename, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + + const header = new ArrayBuffer(44); + const view = new DataView(header); + + // http://soundfile.sapp.org/doc/WaveFormat/ + // F F I R + view.setUint32(0, 0x46464952, true); // chunkID + view.setUint32(4, 36 + samples.length * 2, true); // chunkSize // E V A W + view.setUint32(8, 0x45564157, true); // format // + // t m f + view.setUint32(12, 0x20746d66, true); // subchunk1ID + view.setUint32(16, 16, true); // subchunk1Size, 16 for PCM + view.setUint32(20, 1, true); // audioFormat, 1 for PCM + view.setUint16(22, 1, true); // numChannels: 1 channel + view.setUint32(24, sampleRate, true); // sampleRate + view.setUint32(28, sampleRate * 2, true); // byteRate + view.setUint16(32, 2, true); // blockAlign + view.setUint16(34, 16, true); // bitsPerSample + view.setUint32(36, 0x61746164, true); // Subchunk2ID + view.setUint32(40, samples.length * 2, true); // subchunk2Size + + fs.writeSync(fp.fd, new Uint8Array(header).buffer, { length: header.byteLength }); + fs.writeSync(fp.fd, samples.buffer, { length: samples.buffer.byteLength }); + + fs.closeSync(fp.fd); +} + +function toInt16Samples(samples: Float32Array): Int16Array { + const int16Samples = new Int16Array(samples.length); + for (let i = 0; i < samples.length; ++i) { + let s = samples[i] * 32767; + s = s > 32767 ? 32767 : s; + s = s < -32768 ? -32768 : s; + int16Samples[i] = s; + } + + return int16Samples; +} + @Entry @Component struct Index { - @State message: string = 'Hello World'; + @State title: string = 'Next-gen Kaldi: Text-to-speech'; + @State info: string = ''; + @State btnStartCaption: string = 'Start'; + @State btnStartEnabled: boolean = false; + @State btnStopCaption: string = 'Stop'; + @State btnStopEnabled: boolean = false; + @State btnSaveCaption: string = 'Save'; + @State btnSaveEnabled: boolean = false; @State initTtsDone: boolean = false; @State ttsGeneratedDone: boolean = true; - + @State sampleRate: number = 0; + @State initAudioDone: boolean = false; + private startTime: number = 0; + private stopTime: number = 0; + private inputText: string = ''; + // it specifies only the initial capacity. private workerInstance?: worker.ThreadWorker private readonly scriptURL: string = 'entry/ets/workers/NonStreamingTtsWorker.ets' - - // it specifies only the initial capacity. // note that circular buffer can automatically resize. private sampleBuffer: CircularBuffer = new CircularBuffer(16000 * 5); - @State sampleRate: number = 0; - + private finalSamples: Float32Array | null = null; private audioRenderer: audio.AudioRenderer | null = null; - @State initAudioDone: boolean = false; - - private audioPlayCallback = (buffer: ArrayBuffer) => { - const numSamples = buffer.byteLength / 2; - if (this.sampleBuffer.size() >= numSamples) { - const samples = this.sampleBuffer.get(this.sampleBuffer.head(), numSamples); - const int16Samples = new Int16Array(buffer); - for (let i = 0; i < numSamples; ++i) { - let s = samples[i] * 32767; - s = s > 32767 ? 32767 : s; - s = s < -32768 ? -32768 : s; - int16Samples[i] = s; - } - this.sampleBuffer.pop(numSamples); - } else { - (new Int16Array(buffer)).fill(0); - if (this.ttsGeneratedDone) { - this.audioRenderer?.stop(); - } - } - }; initAudioRenderer() { if (this.audioRenderer) { console.log(`Audio renderer has already been created. Skip creating`); return; - } - // see + } // see // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/using-audiorenderer-for-playback-V5 const audioStreamInfo: audio.AudioStreamInfo = { samplingRate: this.sampleRate, @@ -57,13 +88,11 @@ struct Index { }; const audioRendererInfo: audio.AudioRendererInfo = { - usage: audio.StreamUsage.STREAM_USAGE_MUSIC, - rendererFlags: 0 + usage: audio.StreamUsage.STREAM_USAGE_MUSIC, rendererFlags: 0 }; const audioRendererOptions: audio.AudioRendererOptions = { - streamInfo: audioStreamInfo, - rendererInfo: audioRendererInfo + streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo }; audio.createAudioRenderer(audioRendererOptions, (err, renderer) => { @@ -83,7 +112,7 @@ struct Index { }); } - aboutToAppear() { + async aboutToAppear() { this.workerInstance = new worker.ThreadWorker(this.scriptURL, { name: 'NonStreaming TTS worker' }); @@ -99,6 +128,27 @@ struct Index { if (msgType == 'tts-generate-done') { const samples: Float32Array = e.data['samples'] as Float32Array; const sampleRate = e.data['sampleRate'] as number; + + systemTime.getRealTime((err, data) => { + if (err) { + console.log(`Failed to get stop time`) + } else { + this.stopTime = data; + + const audioDuration = samples.length / sampleRate; + const elapsedSeconds = (this.stopTime - this.startTime) / 1000; + const RTF = elapsedSeconds / audioDuration; + this.info = `Audio duration: ${audioDuration} s +Elapsed: ${elapsedSeconds} s +RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3)} +` + } + }); + + this.finalSamples = samples; + this.ttsGeneratedDone = true; + this.btnSaveEnabled = true; + if (this.sampleRate == 0) { console.log(`sample rate is ${sampleRate}`); this.sampleRate = sampleRate; @@ -120,22 +170,106 @@ struct Index { build() { Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .onClick(()=>{ + Column({ space: 10 }) { + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold).onClick(() => { + + }) + + Row({ space: 10 }) { + Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { + console.log(`input text is ${this.inputText}`); + if (this.workerInstance && this.initTtsDone) { - const text = 'how are you doing?'; - console.log(`sending ${text}`) + this.finalSamples = null; + this.sampleBuffer.reset(); this.ttsGeneratedDone = false; - this.workerInstance.postMessage({msgType: 'tts-generate', text}); + + this.btnStartEnabled = false; + this.btnStopEnabled = true; + this.btnSaveEnabled = false; + console.log(`sending ${this.inputText}`) + this.ttsGeneratedDone = false; + this.startTime = await systemTime.getRealTime(); + this.workerInstance.postMessage({ msgType: 'tts-generate', text: this.inputText }); + } + + }); + + Button(this.btnStopCaption).enabled(this.btnStopEnabled).onClick(() => { + this.ttsGeneratedDone = true; + this.btnStartEnabled = true; + this.btnStopEnabled = false; + this.sampleBuffer.reset(); + }) + + Button(this.btnSaveCaption).enabled(this.btnSaveEnabled).onClick(() => { + if (!this.finalSamples || this.finalSamples.length == 0) { + + this.btnSaveEnabled = false; + return; + } + + let uri: string = ''; + + const audioOptions = new picker.AudioSaveOptions(); // audioOptions.newFileNames = ['o.wav']; + + const audioViewPicker = new picker.AudioViewPicker(); + + audioViewPicker.save(audioOptions).then((audioSelectResult: Array) => { + uri = audioSelectResult[0]; + if (this.finalSamples) { + savePcmToWav(uri, toInt16Samples(this.finalSamples), this.sampleRate); + console.log(`Saved to ${uri}}`); + this.info += `\nSaved to ${uri}`; + } + }); + + }) + } + + if (this.info != '') { + TextArea({ text: this.info }); + } + + TextArea({ placeholder: 'Input text for TTS and click the start button' }) + .width('100%') + .height('100%') + .onChange((text) => { + this.inputText = text; + if (text.trim() == '') { + this.btnStartEnabled = false; + return; } + this.btnStartEnabled = true; + this.info = `Audio duration: 3s; +Elapsed: 2 s +RTF: 2/3=0.66` }) + }.width('100%') + }.height('100%') + } + + private audioPlayCallback = (buffer: ArrayBuffer) => { + const numSamples = buffer.byteLength / 2; + if (this.sampleBuffer.size() >= numSamples) { + const samples = this.sampleBuffer.get(this.sampleBuffer.head(), numSamples); + + const int16Samples = new Int16Array(buffer); + for (let i = 0; i < numSamples; ++i) { + let s = samples[i] * 32767; + s = s > 32767 ? 32767 : s; + s = s < -32768 ? -32768 : s; + int16Samples[i] = s; + } + this.sampleBuffer.pop(numSamples); + } else { + (new Int16Array(buffer)).fill(0); + if (this.ttsGeneratedDone) { + this.audioRenderer?.stop(); + this.btnStartEnabled = true; + this.btnStopEnabled = false; } - .width('100%') } - .height('100%') - } + }; } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index 1c988e29b..0af480413 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -8,6 +8,7 @@ import { buffer } from '@kit.ArkTS'; const workerPort: ThreadWorkerGlobalScope = worker.workerPort; let tts: OfflineTts; +let cancelled = false; function mkdir(context: Context, parts: string[]) { const path = parts.join('/'); @@ -192,6 +193,13 @@ function initTts(context: Context): OfflineTts { return new OfflineTts(config, context.resourceManager); } +function callback(samples: Float32Array): number { + console.log(`here called: ${samples} samples`); + // 0 means to stop generating in C++ + // 1 means to continue generating in C++ + return cancelled? 0 : 1; +} + /** * Defines the event handler to be called when the worker thread receives a message sent by the host thread. * The event handler is executed in the worker thread. @@ -214,15 +222,11 @@ workerPort.onmessage = (e: MessageEvents) => { input.text = text; input.sid = 0; input.speed = 1.0; + input.callback = callback; const ttsOutput: TtsOutput = tts.generate(input); console.log(`sampleRate: ${ttsOutput.sampleRate}`); console.log(`num samples: ${ttsOutput.samples.length}`); - let sum = 0; - for (const s of ttsOutput.samples) { - sum += s; - } - console.log(`sum is ${sum}`); workerPort.postMessage({ 'msgType': 'tts-generate-done', samples: Float32Array.from(ttsOutput.samples), From 830de4d9e7bcaef0fa0b6cb41e8443abe3b35caf Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 3 Dec 2024 18:00:45 +0800 Subject: [PATCH 05/10] Support tts generate async --- .../src/main/cpp/non-streaming-tts.cc | 639 ++++++++++-------- .../main/cpp/types/libsherpa_onnx/Index.d.ts | 9 +- .../main/ets/components/NonStreamingTts.ets | 5 + .../ets/workers/NonStreamingTtsWorker.ets | 20 +- 4 files changed, 394 insertions(+), 279 deletions(-) diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc index dfaac5c13..54602f5f1 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc @@ -5,376 +5,475 @@ #include #include -#include "macros.h" // NOLINT -#include "napi.h" // NOLINT +#include "macros.h" // NOLINT +#include "napi.h" // NOLINT #include "sherpa-onnx/c-api/c-api.h" -/* -notes: +static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig(Napi::Object obj) { + SherpaOnnxOfflineTtsVitsModelConfig c; + memset(&c, 0, sizeof(c)); -(1) ThreadSafeFunction https://github.com/nodejs/node-addon-api/blob/main/doc/threadsafe_function.md -*/ + if (!obj.Has("vits") || !obj.Get("vits").IsObject()) { + return c; + } -static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig( - Napi::Object obj) { - SherpaOnnxOfflineTtsVitsModelConfig c; - memset(&c, 0, sizeof(c)); + Napi::Object o = obj.Get("vits").As(); + SHERPA_ONNX_ASSIGN_ATTR_STR(model, model); + SHERPA_ONNX_ASSIGN_ATTR_STR(lexicon, lexicon); + SHERPA_ONNX_ASSIGN_ATTR_STR(tokens, tokens); + SHERPA_ONNX_ASSIGN_ATTR_STR(data_dir, dataDir); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale, noiseScale); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale_w, noiseScaleW); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(length_scale, lengthScale); + SHERPA_ONNX_ASSIGN_ATTR_STR(dict_dir, dictDir); - if (!obj.Has("vits") || !obj.Get("vits").IsObject()) { return c; - } - - Napi::Object o = obj.Get("vits").As(); - SHERPA_ONNX_ASSIGN_ATTR_STR(model, model); - SHERPA_ONNX_ASSIGN_ATTR_STR(lexicon, lexicon); - SHERPA_ONNX_ASSIGN_ATTR_STR(tokens, tokens); - SHERPA_ONNX_ASSIGN_ATTR_STR(data_dir, dataDir); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale, noiseScale); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale_w, noiseScaleW); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(length_scale, lengthScale); - SHERPA_ONNX_ASSIGN_ATTR_STR(dict_dir, dictDir); - - return c; } -static SherpaOnnxOfflineTtsModelConfig GetOfflineTtsModelConfig( - Napi::Object obj) { - SherpaOnnxOfflineTtsModelConfig c; - memset(&c, 0, sizeof(c)); +static SherpaOnnxOfflineTtsModelConfig GetOfflineTtsModelConfig(Napi::Object obj) { + SherpaOnnxOfflineTtsModelConfig c; + memset(&c, 0, sizeof(c)); - if (!obj.Has("model") || !obj.Get("model").IsObject()) { - return c; - } + if (!obj.Has("model") || !obj.Get("model").IsObject()) { + return c; + } - Napi::Object o = obj.Get("model").As(); + Napi::Object o = obj.Get("model").As(); - c.vits = GetOfflineTtsVitsModelConfig(o); + c.vits = GetOfflineTtsVitsModelConfig(o); - SHERPA_ONNX_ASSIGN_ATTR_INT32(num_threads, numThreads); + SHERPA_ONNX_ASSIGN_ATTR_INT32(num_threads, numThreads); - if (o.Has("debug") && - (o.Get("debug").IsNumber() || o.Get("debug").IsBoolean())) { - if (o.Get("debug").IsBoolean()) { - c.debug = o.Get("debug").As().Value(); - } else { - c.debug = o.Get("debug").As().Int32Value(); + if (o.Has("debug") && (o.Get("debug").IsNumber() || o.Get("debug").IsBoolean())) { + if (o.Get("debug").IsBoolean()) { + c.debug = o.Get("debug").As().Value(); + } else { + c.debug = o.Get("debug").As().Int32Value(); + } } - } - SHERPA_ONNX_ASSIGN_ATTR_STR(provider, provider); + SHERPA_ONNX_ASSIGN_ATTR_STR(provider, provider); - return c; + return c; } -static Napi::External CreateOfflineTtsWrapper( - const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::External CreateOfflineTtsWrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); #if __OHOS__ - // the last argument is the NativeResourceManager - if (info.Length() != 2) { - std::ostringstream os; - os << "Expect only 2 arguments. Given: " << info.Length(); + // the last argument is the NativeResourceManager + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } #else - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } #endif - if (!info[0].IsObject()) { - Napi::TypeError::New(env, "Expect an object as the argument") - .ThrowAsJavaScriptException(); + if (!info[0].IsObject()) { + Napi::TypeError::New(env, "Expect an object as the argument").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - Napi::Object o = info[0].As(); + Napi::Object o = info[0].As(); - SherpaOnnxOfflineTtsConfig c; - memset(&c, 0, sizeof(c)); + SherpaOnnxOfflineTtsConfig c; + memset(&c, 0, sizeof(c)); - c.model = GetOfflineTtsModelConfig(o); + c.model = GetOfflineTtsModelConfig(o); - SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts); - SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences); - SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars); + SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts); + SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences); + SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars); #if __OHOS__ - std::unique_ptr - mgr(OH_ResourceManager_InitNativeResourceManager(env, info[1]), - &OH_ResourceManager_ReleaseNativeResourceManager); - SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTtsOHOS(&c, mgr.get()); + std::unique_ptr mgr( + OH_ResourceManager_InitNativeResourceManager(env, info[1]), &OH_ResourceManager_ReleaseNativeResourceManager); + SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTtsOHOS(&c, mgr.get()); #else - SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTts(&c); + SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTts(&c); #endif - if (c.model.vits.model) { - delete[] c.model.vits.model; - } + if (c.model.vits.model) { + delete[] c.model.vits.model; + } - if (c.model.vits.lexicon) { - delete[] c.model.vits.lexicon; - } + if (c.model.vits.lexicon) { + delete[] c.model.vits.lexicon; + } - if (c.model.vits.tokens) { - delete[] c.model.vits.tokens; - } + if (c.model.vits.tokens) { + delete[] c.model.vits.tokens; + } - if (c.model.vits.data_dir) { - delete[] c.model.vits.data_dir; - } + if (c.model.vits.data_dir) { + delete[] c.model.vits.data_dir; + } - if (c.model.vits.dict_dir) { - delete[] c.model.vits.dict_dir; - } + if (c.model.vits.dict_dir) { + delete[] c.model.vits.dict_dir; + } - if (c.model.provider) { - delete[] c.model.provider; - } + if (c.model.provider) { + delete[] c.model.provider; + } - if (c.rule_fsts) { - delete[] c.rule_fsts; - } + if (c.rule_fsts) { + delete[] c.rule_fsts; + } - if (c.rule_fars) { - delete[] c.rule_fars; - } + if (c.rule_fars) { + delete[] c.rule_fars; + } - if (!tts) { - Napi::TypeError::New(env, "Please check your config!") - .ThrowAsJavaScriptException(); + if (!tts) { + Napi::TypeError::New(env, "Please check your config!").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - return Napi::External::New( - env, tts, [](Napi::Env env, SherpaOnnxOfflineTts *tts) { - SherpaOnnxDestroyOfflineTts(tts); - }); + return Napi::External::New( + env, tts, [](Napi::Env env, SherpaOnnxOfflineTts *tts) { SherpaOnnxDestroyOfflineTts(tts); }); } -static Napi::Number OfflineTtsSampleRateWrapper( - const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::Number OfflineTtsSampleRateWrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") - .ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = - info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = info[0].As>().Data(); - int32_t sample_rate = SherpaOnnxOfflineTtsSampleRate(tts); + int32_t sample_rate = SherpaOnnxOfflineTtsSampleRate(tts); - return Napi::Number::New(env, sample_rate); + return Napi::Number::New(env, sample_rate); } -static Napi::Number OfflineTtsNumSpeakersWrapper( - const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::Number OfflineTtsNumSpeakersWrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") - .ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = - info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = info[0].As>().Data(); - int32_t num_speakers = SherpaOnnxOfflineTtsNumSpeakers(tts); + int32_t num_speakers = SherpaOnnxOfflineTtsNumSpeakers(tts); - return Napi::Number::New(env, num_speakers); + return Napi::Number::New(env, num_speakers); } +// synchronous version static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); + Napi::Env env = info.Env(); - if (info.Length() != 2) { - std::ostringstream os; - os << "Expect only 2 arguments. Given: " << info.Length(); + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") - .ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = - info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = info[0].As>().Data(); - if (!info[1].IsObject()) { - Napi::TypeError::New(env, "Argument 1 should be an object") - .ThrowAsJavaScriptException(); + if (!info[1].IsObject()) { + Napi::TypeError::New(env, "Argument 1 should be an object").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - Napi::Object obj = info[1].As(); + Napi::Object obj = info[1].As(); - if (!obj.Has("text")) { - Napi::TypeError::New(env, "The argument object should have a field text") - .ThrowAsJavaScriptException(); + if (!obj.Has("text")) { + Napi::TypeError::New(env, "The argument object should have a field text").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("text").IsString()) { - Napi::TypeError::New(env, "The object['text'] should be a string") - .ThrowAsJavaScriptException(); + if (!obj.Get("text").IsString()) { + Napi::TypeError::New(env, "The object['text'] should be a string").ThrowAsJavaScriptException(); - return {}; - } + return {}; + } + + if (!obj.Has("sid")) { + Napi::TypeError::New(env, "The argument object should have a field sid").ThrowAsJavaScriptException(); - if (!obj.Has("sid")) { - Napi::TypeError::New(env, "The argument object should have a field sid") - .ThrowAsJavaScriptException(); + return {}; + } - return {}; - } + if (!obj.Get("sid").IsNumber()) { + Napi::TypeError::New(env, "The object['sid'] should be a number").ThrowAsJavaScriptException(); - if (!obj.Get("sid").IsNumber()) { - Napi::TypeError::New(env, "The object['sid'] should be a number") - .ThrowAsJavaScriptException(); + return {}; + } - return {}; - } + if (!obj.Has("speed")) { + Napi::TypeError::New(env, "The argument object should have a field speed").ThrowAsJavaScriptException(); - if (!obj.Has("speed")) { - Napi::TypeError::New(env, "The argument object should have a field speed") - .ThrowAsJavaScriptException(); + return {}; + } - return {}; - } + if (!obj.Get("speed").IsNumber()) { + Napi::TypeError::New(env, "The object['speed'] should be a number").ThrowAsJavaScriptException(); - if (!obj.Get("speed").IsNumber()) { - Napi::TypeError::New(env, "The object['speed'] should be a number") - .ThrowAsJavaScriptException(); + return {}; + } - return {}; - } + bool enable_external_buffer = true; + if (obj.Has("enableExternalBuffer") && obj.Get("enableExternalBuffer").IsBoolean()) { + enable_external_buffer = obj.Get("enableExternalBuffer").As().Value(); + } - bool enable_external_buffer = true; - if (obj.Has("enableExternalBuffer") && - obj.Get("enableExternalBuffer").IsBoolean()) { - enable_external_buffer = - obj.Get("enableExternalBuffer").As().Value(); - } + Napi::String _text = obj.Get("text").As(); + std::string text = _text.Utf8Value(); + int32_t sid = obj.Get("sid").As().Int32Value(); + float speed = obj.Get("speed").As().FloatValue(); - Napi::String _text = obj.Get("text").As(); - std::string text = _text.Utf8Value(); - int32_t sid = obj.Get("sid").As().Int32Value(); - float speed = obj.Get("speed").As().FloatValue(); - - const SherpaOnnxGeneratedAudio *audio; - if (obj.Has("callback") && obj.Get("callback").IsFunction()) { - Napi::Function cb = obj.Get("callback").As(); + const SherpaOnnxGeneratedAudio *audio; + if (obj.Has("callback") && obj.Get("callback").IsFunction()) { + Napi::Function cb = obj.Get("callback").As(); struct MyCallbackArg { - Napi::Env* penv; - Napi::Function* pcb; + Napi::Env *penv; + Napi::Function *pcb; + }; + + MyCallbackArg arg = {&env, &cb}; + + auto callback = [](const float *samples, int32_t n, void *arg) -> int { + auto parg = reinterpret_cast(arg); + + Napi::Float32Array float32Array = Napi::Float32Array::New(*parg->penv, n); + + std::copy(samples, samples + n, float32Array.Data()); + + parg->pcb->Call({float32Array}); + return 1; }; + audio = SherpaOnnxOfflineTtsGenerateWithCallbackWithArg(tts, text.c_str(), sid, speed, callback, &arg); + } else { + audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); + } + + if (enable_external_buffer) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( + env, const_cast(audio->samples), sizeof(float) * audio->n, + [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { + SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); + }, + audio); + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); + + Napi::Object ans = Napi::Object::New(env); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); + return ans; + } else { + // don't use external buffer + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio->n); + + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); + + std::copy(audio->samples, audio->samples + audio->n, float32Array.Data()); + + Napi::Object ans = Napi::Object::New(env); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); + SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio); + return ans; + } +} + +class TtsGenerateWorker : public Napi::AsyncWorker { +public: + TtsGenerateWorker(const Napi::Env &env, SherpaOnnxOfflineTts *tts, const std::string &text, float speed, + int32_t sid, bool use_external_buffer) + : Napi::AsyncWorker{env, "TtsGenerateWorker"}, deferred_(env), tts_(tts), text_(text), speed_(speed), + sid_(sid), use_external_buffer_(use_external_buffer) {} + + Napi::Promise Promise() { return deferred_.Promise(); } + +protected: + void Execute() override { + audio_ = SherpaOnnxOfflineTtsGenerate(tts_, text_.c_str(), sid_, speed_); + + } + + void OnOK() override { - MyCallbackArg arg = {&env, &cb}; + Napi::Env env = deferred_.Env(); + Napi::Object ans = Napi::Object::New(env); + if (use_external_buffer_) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( + env, const_cast(audio_->samples), sizeof(float) * audio_->n, + [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { + SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); + }, + audio_); + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + } else { + // don't use external buffer + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio_->n); + + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + + std::copy(audio_->samples, audio_->samples + audio_->n, float32Array.Data()); + + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio_); + } - auto callback = [](const float* samples, int32_t n, void*arg)->int { - auto parg = reinterpret_cast(arg); - - Napi::Float32Array float32Array = - Napi::Float32Array::New(*parg->penv, n); - - std::copy(samples, samples + n, float32Array.Data()); - - parg->pcb->Call({float32Array}); - return 1; - }; - audio = SherpaOnnxOfflineTtsGenerateWithCallbackWithArg(tts, text.c_str(), sid, speed, callback, &arg); - } else { - audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); - } - - - - if (enable_external_buffer) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( - env, const_cast(audio->samples), sizeof(float) * audio->n, - [](Napi::Env /*env*/, void * /*data*/, - const SherpaOnnxGeneratedAudio *hint) { - SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); - }, - audio); - Napi::Float32Array float32Array = - Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); - - Napi::Object ans = Napi::Object::New(env); - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); - return ans; - } else { - // don't use external buffer - Napi::ArrayBuffer arrayBuffer = - Napi::ArrayBuffer::New(env, sizeof(float) * audio->n); - - Napi::Float32Array float32Array = - Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); - - std::copy(audio->samples, audio->samples + audio->n, float32Array.Data()); - - Napi::Object ans = Napi::Object::New(env); - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); - SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio); - return ans; - } + deferred_.Resolve(ans); + } + +private: + Napi::Promise::Deferred deferred_; + SherpaOnnxOfflineTts *tts_; + std::string text_; + float speed_; + int32_t sid_; + bool use_external_buffer_; + + const SherpaOnnxGeneratedAudio *audio_; +}; + +static Napi::Object OfflineTtsGenerateAsyncWrapper(const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); + + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); + + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + + return {}; + } + + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); + + return {}; + } + + SherpaOnnxOfflineTts *tts = info[0].As>().Data(); + + if (!info[1].IsObject()) { + Napi::TypeError::New(env, "Argument 1 should be an object").ThrowAsJavaScriptException(); + + return {}; + } + + Napi::Object obj = info[1].As(); + + if (!obj.Has("text")) { + Napi::TypeError::New(env, "The argument object should have a field text").ThrowAsJavaScriptException(); + + return {}; + } + + if (!obj.Get("text").IsString()) { + Napi::TypeError::New(env, "The object['text'] should be a string").ThrowAsJavaScriptException(); + + return {}; + } + + if (!obj.Has("sid")) { + Napi::TypeError::New(env, "The argument object should have a field sid").ThrowAsJavaScriptException(); + + return {}; + } + + if (!obj.Get("sid").IsNumber()) { + Napi::TypeError::New(env, "The object['sid'] should be a number").ThrowAsJavaScriptException(); + + return {}; + } + + if (!obj.Has("speed")) { + Napi::TypeError::New(env, "The argument object should have a field speed").ThrowAsJavaScriptException(); + + return {}; + } + + if (!obj.Get("speed").IsNumber()) { + Napi::TypeError::New(env, "The object['speed'] should be a number").ThrowAsJavaScriptException(); + + return {}; + } + + bool enable_external_buffer = true; + if (obj.Has("enableExternalBuffer") && obj.Get("enableExternalBuffer").IsBoolean()) { + enable_external_buffer = obj.Get("enableExternalBuffer").As().Value(); + } + + Napi::String _text = obj.Get("text").As(); + std::string text = _text.Utf8Value(); + int32_t sid = obj.Get("sid").As().Int32Value(); + float speed = obj.Get("speed").As().FloatValue(); + + const SherpaOnnxGeneratedAudio *audio; + TtsGenerateWorker* worker = new TtsGenerateWorker(env, tts, text, speed, sid, enable_external_buffer); + worker->Queue(); + return worker->Promise(); } void InitNonStreamingTts(Napi::Env env, Napi::Object exports) { - exports.Set(Napi::String::New(env, "createOfflineTts"), - Napi::Function::New(env, CreateOfflineTtsWrapper)); + exports.Set(Napi::String::New(env, "createOfflineTts"), Napi::Function::New(env, CreateOfflineTtsWrapper)); + + exports.Set(Napi::String::New(env, "getOfflineTtsSampleRate"), + Napi::Function::New(env, OfflineTtsSampleRateWrapper)); - exports.Set(Napi::String::New(env, "getOfflineTtsSampleRate"), - Napi::Function::New(env, OfflineTtsSampleRateWrapper)); + exports.Set(Napi::String::New(env, "getOfflineTtsNumSpeakers"), + Napi::Function::New(env, OfflineTtsNumSpeakersWrapper)); - exports.Set(Napi::String::New(env, "getOfflineTtsNumSpeakers"), - Napi::Function::New(env, OfflineTtsNumSpeakersWrapper)); + exports.Set(Napi::String::New(env, "offlineTtsGenerate"), Napi::Function::New(env, OfflineTtsGenerateWrapper)); - exports.Set(Napi::String::New(env, "offlineTtsGenerate"), - Napi::Function::New(env, OfflineTtsGenerateWrapper)); + exports.Set(Napi::String::New(env, "offlineTtsGenerateAsync"), + Napi::Function::New(env, OfflineTtsGenerateAsyncWrapper)); } diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts index 1fa304099..057d5af25 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/types/libsherpa_onnx/Index.d.ts @@ -39,4 +39,11 @@ export const getOnlineStreamResultAsJson: (handle: object, streamHandle: object) export const createOfflineTts: (config: object, mgr?: object) => object; export const getOfflineTtsNumSpeakers: (handle: object) => number; export const getOfflineTtsSampleRate: (handle: object) => number; -export const offlineTtsGenerate: (handle: object, input: object) => object; + +export type TtsOutput = { + samples: Float32Array; + sampleRate: number; +}; + +export const offlineTtsGenerate: (handle: object, input: object) => TtsOutput; +export const offlineTtsGenerateAsync: (handle: object, input: object) => Promise; diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets index 5c7d86229..dc807aa4e 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets @@ -3,6 +3,7 @@ import { getOfflineTtsNumSpeakers, getOfflineTtsSampleRate, offlineTtsGenerate, + offlineTtsGenerateAsync, } from "libsherpa_onnx.so"; export class OfflineTtsVitsModelConfig { @@ -65,4 +66,8 @@ export class OfflineTts { generate(input: TtsInput): TtsOutput { return offlineTtsGenerate(this.handle, input) as TtsOutput; } + + generateAsync(input: TtsInput): Promise { + return offlineTtsGenerateAsync(this.handle, input); + } } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index 0af480413..91a99082a 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -223,14 +223,18 @@ workerPort.onmessage = (e: MessageEvents) => { input.sid = 0; input.speed = 1.0; input.callback = callback; - const ttsOutput: TtsOutput = tts.generate(input); - console.log(`sampleRate: ${ttsOutput.sampleRate}`); - console.log(`num samples: ${ttsOutput.samples.length}`); - - workerPort.postMessage({ - 'msgType': 'tts-generate-done', - samples: Float32Array.from(ttsOutput.samples), - sampleRate: ttsOutput.sampleRate }); + // const ttsOutput: TtsOutput = tts.generateAsync(input); + tts.generateAsync(input).then((ttsOutput: TtsOutput) => { + console.log(`sampleRate: ${ttsOutput.sampleRate}`); + console.log(`num samples: ${ttsOutput.samples.length}`); + + workerPort.postMessage({ + 'msgType': 'tts-generate-done', + samples: Float32Array.from(ttsOutput.samples), + sampleRate: ttsOutput.sampleRate }); + + }); + } } From f99c7536c543a5a18ab1f188f5cf76d7ccca663e Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 4 Dec 2024 10:43:29 +0800 Subject: [PATCH 06/10] first working version with promise-based tts async generate --- .../src/main/cpp/non-streaming-tts.cc | 173 ++++++++++++------ .../main/ets/components/NonStreamingTts.ets | 7 +- .../src/main/ets/components/Vad.ets | 1 - .../entry/src/main/ets/pages/Index.ets | 75 +++++--- .../ets/workers/NonStreamingTtsWorker.ets | 29 ++- sherpa-onnx/c-api/c-api.cc | 11 ++ sherpa-onnx/c-api/c-api.h | 11 ++ sherpa-onnx/csrc/circular-buffer.cc | 16 +- sherpa-onnx/csrc/offline-tts-vits-impl.h | 2 +- 9 files changed, 233 insertions(+), 92 deletions(-) diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc index 54602f5f1..45f9fe40c 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc @@ -9,6 +9,7 @@ #include "napi.h" // NOLINT #include "sherpa-onnx/c-api/c-api.h" + static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig(Napi::Object obj) { SherpaOnnxOfflineTtsVitsModelConfig c; memset(&c, 0, sizeof(c)); @@ -273,29 +274,7 @@ static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { float speed = obj.Get("speed").As().FloatValue(); const SherpaOnnxGeneratedAudio *audio; - if (obj.Has("callback") && obj.Get("callback").IsFunction()) { - Napi::Function cb = obj.Get("callback").As(); - struct MyCallbackArg { - Napi::Env *penv; - Napi::Function *pcb; - }; - - MyCallbackArg arg = {&env, &cb}; - - auto callback = [](const float *samples, int32_t n, void *arg) -> int { - auto parg = reinterpret_cast(arg); - - Napi::Float32Array float32Array = Napi::Float32Array::New(*parg->penv, n); - - std::copy(samples, samples + n, float32Array.Data()); - - parg->pcb->Call({float32Array}); - return 1; - }; - audio = SherpaOnnxOfflineTtsGenerateWithCallbackWithArg(tts, text.c_str(), sid, speed, callback, &arg); - } else { - audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); - } + audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); if (enable_external_buffer) { Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( @@ -326,61 +305,129 @@ static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { } } +struct TtsCallbackData { + std::vector samples; + float progress; + bool processed = false; + bool cancelled = false; +}; + +// see +// https://github.com/nodejs/node-addon-examples/blob/main/src/6-threadsafe-function/typed_threadsafe_function/node-addon-api/clock.cc +void InvokeJsCallback(Napi::Env env, Napi::Function callback, Napi::Reference* context, + TtsCallbackData *data) { + if (env != nullptr) { + if (callback != nullptr) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * data->samples.size()); + + Napi::Float32Array float32Array = Napi::Float32Array::New(env, data->samples.size(), arrayBuffer, 0); + + std::copy(data->samples.begin(), data->samples.end(), float32Array.Data()); + + Napi::Object arg = Napi::Object::New(env); + arg.Set(Napi::String::New(env, "samples"), float32Array); + arg.Set(Napi::String::New(env, "progress"), data->progress); + + auto v = callback.Call(context->Value(), {arg}); + data->processed = true; + if (v.IsNumber() && v.As().Int32Value()) { + data->cancelled = false; + } else { + data->cancelled = true; + } + } + } +} + +using TSFN = Napi::TypedThreadSafeFunction, TtsCallbackData, InvokeJsCallback>; + class TtsGenerateWorker : public Napi::AsyncWorker { public: - TtsGenerateWorker(const Napi::Env &env, SherpaOnnxOfflineTts *tts, const std::string &text, float speed, + TtsGenerateWorker(const Napi::Env &env, TSFN tsfn, SherpaOnnxOfflineTts *tts, const std::string &text, float speed, int32_t sid, bool use_external_buffer) - : Napi::AsyncWorker{env, "TtsGenerateWorker"}, deferred_(env), tts_(tts), text_(text), speed_(speed), - sid_(sid), use_external_buffer_(use_external_buffer) {} + :tsfn_(tsfn), Napi::AsyncWorker{env, "TtsGenerateWorker"}, deferred_(env), tts_(tts), text_(text), speed_(speed), sid_(sid), + use_external_buffer_(use_external_buffer) {} Napi::Promise Promise() { return deferred_.Promise(); } + + ~TtsGenerateWorker() { + OH_LOG_INFO(LOG_APP, "destroyed"); + int i = 0; + for (auto d: data_list_) { + OH_LOG_INFO(LOG_APP, " %{public}d", i); + i++; + delete d; + } + } protected: void Execute() override { - audio_ = SherpaOnnxOfflineTtsGenerate(tts_, text_.c_str(), sid_, speed_); - + auto callback = [] (const float* samples, int32_t n, float progress, void* arg)-> int32_t { + TtsGenerateWorker* _this = reinterpret_cast(arg); + + for (auto d: _this->data_list_) { + if (d->cancelled) { + OH_LOG_INFO(LOG_APP, "TtsGenerate is cancelled"); + return 0; + } + } + + auto data = new TtsCallbackData; + data->samples = std::vector{samples, samples + n}; + data->progress = progress; + _this->data_list_.push_back(data); + + _this->tsfn_.NonBlockingCall(data); + + return 1; + }; + audio_ = SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg(tts_, text_.c_str(), sid_, speed_, callback, this); + + tsfn_.Release(); } - void OnOK() override { - - Napi::Env env = deferred_.Env(); + void OnOK() override { + Napi::Env env = deferred_.Env(); Napi::Object ans = Napi::Object::New(env); - if (use_external_buffer_) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( - env, const_cast(audio_->samples), sizeof(float) * audio_->n, - [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { - SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); - }, - audio_); - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + if (use_external_buffer_) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( + env, const_cast(audio_->samples), sizeof(float) * audio_->n, + [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { + SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); + }, + audio_); + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + } else { + // don't use external buffer + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio_->n); - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); - } else { - // don't use external buffer - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio_->n); + Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + std::copy(audio_->samples, audio_->samples + audio_->n, float32Array.Data()); - std::copy(audio_->samples, audio_->samples + audio_->n, float32Array.Data()); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio_); + } - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); - SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio_); - } - deferred_.Resolve(ans); } private: + TSFN tsfn_; Napi::Promise::Deferred deferred_; SherpaOnnxOfflineTts *tts_; std::string text_; float speed_; int32_t sid_; bool use_external_buffer_; - + const SherpaOnnxGeneratedAudio *audio_; + + std::vector data_list_; }; static Napi::Object OfflineTtsGenerateAsyncWrapper(const Napi::CallbackInfo &info) { @@ -456,9 +503,29 @@ static Napi::Object OfflineTtsGenerateAsyncWrapper(const Napi::CallbackInfo &inf std::string text = _text.Utf8Value(); int32_t sid = obj.Get("sid").As().Int32Value(); float speed = obj.Get("speed").As().FloatValue(); + + Napi::Function cb; + if (obj.Has("callback") && obj.Get("callback").IsFunction()) { + cb = obj.Get("callback").As(); + } + + auto context = new Napi::Reference(Napi::Persistent(info.This())); + + TSFN tsfn = TSFN::New( + env, + cb, // JavaScript function called asynchronously + "TtsGenerateFunc", // Name + 0, // Unlimited queue + 1, // Only one thread will use this initially + context, + [](Napi::Env, + void*, + Napi::Reference* ctx) { + delete ctx; + }); const SherpaOnnxGeneratedAudio *audio; - TtsGenerateWorker* worker = new TtsGenerateWorker(env, tts, text, speed, sid, enable_external_buffer); + TtsGenerateWorker *worker = new TtsGenerateWorker(env, tsfn, tts, text, speed, sid, enable_external_buffer); worker->Queue(); return worker->Promise(); } diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets index dc807aa4e..a60a0e748 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/NonStreamingTts.ets @@ -36,11 +36,16 @@ export class TtsOutput { public sampleRate: number = 0; } +interface TtsCallbackData { + samples: Float32Array; + progress: number; +} + export class TtsInput { public text: string = ''; public sid: number = 0; public speed: number = 1.0; - public callback?: (samples: Float32Array) => number; + public callback?: (data: TtsCallbackData) => number; } export class OfflineTts { diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/Vad.ets b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/Vad.ets index 155eac680..8f1bf18d6 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/Vad.ets +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/ets/components/Vad.ets @@ -57,7 +57,6 @@ export class CircularBuffer { // samples is a float32 array push(samples: Float32Array) { - console.log(`here samples: ${samples}`); circularBufferPush(this.handle, samples); } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 23fbdef1f..debb106e6 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -16,8 +16,7 @@ function savePcmToWav(filename: string, samples: Int16Array, sampleRate: number) // F F I R view.setUint32(0, 0x46464952, true); // chunkID view.setUint32(4, 36 + samples.length * 2, true); // chunkSize // E V A W - view.setUint32(8, 0x45564157, true); // format // - // t m f + view.setUint32(8, 0x45564157, true); // format // // t m f view.setUint32(12, 0x20746d66, true); // subchunk1ID view.setUint32(16, 16, true); // subchunk1Size, 16 for PCM view.setUint32(20, 1, true); // audioFormat, 1 for PCM @@ -59,10 +58,13 @@ struct Index { @State btnStopEnabled: boolean = false; @State btnSaveCaption: string = 'Save'; @State btnSaveEnabled: boolean = false; + private cancelled: boolean = false; + @State isGenerating: boolean = false; @State initTtsDone: boolean = false; @State ttsGeneratedDone: boolean = true; - @State sampleRate: number = 0; + @State numSpeakers: number = 1; @State initAudioDone: boolean = false; + private sampleRate: number = 0; private startTime: number = 0; private stopTime: number = 0; private inputText: string = ''; @@ -78,8 +80,7 @@ struct Index { if (this.audioRenderer) { console.log(`Audio renderer has already been created. Skip creating`); return; - } // see - // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/using-audiorenderer-for-playback-V5 + } // see // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/using-audiorenderer-for-playback-V5 const audioStreamInfo: audio.AudioStreamInfo = { samplingRate: this.sampleRate, channels: audio.AudioChannel.CHANNEL_1, // 通道 @@ -122,26 +123,50 @@ struct Index { if (msgType == 'init-tts-done') { console.log('init tts done'); + this.sampleRate = e.data['sampleRate'] as number; + this.numSpeakers = e.data['numSpeakers'] as number; + this.initTtsDone = true; } + if (msgType == 'tts-generate-partial') { + if (this.cancelled) { + return; + } + + const samples: Float32Array = e.data['samples'] as Float32Array; + const progress: number = e.data['progress'] as number; + console.log(`progress: ${progress}`); + + this.sampleBuffer.push(samples); + + if (!this.initAudioDone) { + this.initAudioRenderer(); + } + + if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING) { + this.audioRenderer.start(); + } + } + if (msgType == 'tts-generate-done') { + this.isGenerating = false; const samples: Float32Array = e.data['samples'] as Float32Array; - const sampleRate = e.data['sampleRate'] as number; systemTime.getRealTime((err, data) => { + if (err) { console.log(`Failed to get stop time`) } else { this.stopTime = data; - const audioDuration = samples.length / sampleRate; + const audioDuration = samples.length / this.sampleRate; const elapsedSeconds = (this.stopTime - this.startTime) / 1000; const RTF = elapsedSeconds / audioDuration; this.info = `Audio duration: ${audioDuration} s Elapsed: ${elapsedSeconds} s RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3)} -` +`; } }); @@ -149,19 +174,7 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.ttsGeneratedDone = true; this.btnSaveEnabled = true; - if (this.sampleRate == 0) { - console.log(`sample rate is ${sampleRate}`); - this.sampleRate = sampleRate; - } - this.sampleBuffer.push(samples); this.ttsGeneratedDone = true; - if (!this.initAudioDone) { - this.initAudioRenderer(); - } - - if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING) { - this.audioRenderer.start(); - } } } @@ -171,15 +184,14 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 build() { Row() { Column({ space: 10 }) { - Text(this.title).fontSize(20).fontWeight(FontWeight.Bold).onClick(() => { - - }) + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); Row({ space: 10 }) { Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { console.log(`input text is ${this.inputText}`); if (this.workerInstance && this.initTtsDone) { + this.cancelled = false; this.finalSamples = null; this.sampleBuffer.reset(); this.ttsGeneratedDone = false; @@ -191,8 +203,9 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.ttsGeneratedDone = false; this.startTime = await systemTime.getRealTime(); this.workerInstance.postMessage({ msgType: 'tts-generate', text: this.inputText }); + this.isGenerating = true; + this.info = ''; } - }); Button(this.btnStopCaption).enabled(this.btnStopEnabled).onClick(() => { @@ -200,6 +213,13 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.btnStartEnabled = true; this.btnStopEnabled = false; this.sampleBuffer.reset(); + this.cancelled = true; + this.isGenerating = false; + + if (this.workerInstance && this.initTtsDone) { + this.workerInstance.postMessage({ msgType: 'tts-generate-cancel'}); + } + this.audioRenderer?.stop(); }) Button(this.btnSaveCaption).enabled(this.btnSaveEnabled).onClick(() => { @@ -234,6 +254,7 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 TextArea({ placeholder: 'Input text for TTS and click the start button' }) .width('100%') .height('100%') + .focusable(this.isGenerating == false) .onChange((text) => { this.inputText = text; if (text.trim() == '') { @@ -241,10 +262,6 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 return; } this.btnStartEnabled = true; - this.info = `Audio duration: 3s; -Elapsed: 2 s -RTF: 2/3=0.66` - }) }.width('100%') }.height('100%') @@ -253,7 +270,7 @@ RTF: 2/3=0.66` private audioPlayCallback = (buffer: ArrayBuffer) => { const numSamples = buffer.byteLength / 2; if (this.sampleBuffer.size() >= numSamples) { - const samples = this.sampleBuffer.get(this.sampleBuffer.head(), numSamples); + const samples: Float32Array = this.sampleBuffer.get(this.sampleBuffer.head(), numSamples); const int16Samples = new Int16Array(buffer); for (let i = 0; i < numSamples; ++i) { diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index 91a99082a..a278cf775 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -193,8 +193,18 @@ function initTts(context: Context): OfflineTts { return new OfflineTts(config, context.resourceManager); } -function callback(samples: Float32Array): number { - console.log(`here called: ${samples} samples`); +interface TtsCallbackData { + samples: Float32Array; + progress: number; +} + +function callback(data: TtsCallbackData): number { + workerPort.postMessage({ + 'msgType': 'tts-generate-partial', + samples: Float32Array.from(data.samples), + progress: data.progress, + }); + // 0 means to stop generating in C++ // 1 means to continue generating in C++ return cancelled? 0 : 1; @@ -211,8 +221,15 @@ workerPort.onmessage = (e: MessageEvents) => { console.log(`msg-type: ${msgType}`); if (msgType == 'init-tts' && !tts) { const context = e.data['context'] as Context; - workerPort.postMessage({ 'msgType': 'init-tts-done' }); tts = initTts(context); + workerPort.postMessage({ 'msgType': 'init-tts-done', + sampleRate: tts.sampleRate, + numSpeakers: tts.numSpeakers, + }); + } + + if (msgType == 'tts-generate-cancel') { + cancelled = true; } if (msgType == 'tts-generate') { @@ -223,15 +240,15 @@ workerPort.onmessage = (e: MessageEvents) => { input.sid = 0; input.speed = 1.0; input.callback = callback; - // const ttsOutput: TtsOutput = tts.generateAsync(input); + + cancelled = false; tts.generateAsync(input).then((ttsOutput: TtsOutput) => { console.log(`sampleRate: ${ttsOutput.sampleRate}`); - console.log(`num samples: ${ttsOutput.samples.length}`); workerPort.postMessage({ 'msgType': 'tts-generate-done', samples: Float32Array.from(ttsOutput.samples), - sampleRate: ttsOutput.sampleRate }); + }); }); diff --git a/sherpa-onnx/c-api/c-api.cc b/sherpa-onnx/c-api/c-api.cc index 166430da4..e25097809 100644 --- a/sherpa-onnx/c-api/c-api.cc +++ b/sherpa-onnx/c-api/c-api.cc @@ -1169,6 +1169,17 @@ SherpaOnnxOfflineTtsGenerateWithProgressCallback( return SherpaOnnxOfflineTtsGenerateInternal(tts, text, sid, speed, wrapper); } +const SherpaOnnxGeneratedAudio * +SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg( + const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, + SherpaOnnxGeneratedAudioProgressCallbackWithArg callback, void *arg) { + auto wrapper = [callback, arg](const float *samples, int32_t n, + float progress) { + return callback(samples, n, progress, arg); + }; + return SherpaOnnxOfflineTtsGenerateInternal(tts, text, sid, speed, wrapper); +} + const SherpaOnnxGeneratedAudio *SherpaOnnxOfflineTtsGenerateWithCallbackWithArg( const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioCallbackWithArg callback, void *arg) { diff --git a/sherpa-onnx/c-api/c-api.h b/sherpa-onnx/c-api/c-api.h index e9cd5be0a..fde626e99 100644 --- a/sherpa-onnx/c-api/c-api.h +++ b/sherpa-onnx/c-api/c-api.h @@ -930,6 +930,9 @@ typedef int32_t (*SherpaOnnxGeneratedAudioCallbackWithArg)(const float *samples, typedef int32_t (*SherpaOnnxGeneratedAudioProgressCallback)( const float *samples, int32_t n, float p); +typedef int32_t (*SherpaOnnxGeneratedAudioProgressCallbackWithArg)( + const float *samples, int32_t n, float p, void *arg); + SHERPA_ONNX_API typedef struct SherpaOnnxOfflineTts SherpaOnnxOfflineTts; // Create an instance of offline TTS. The user has to use DestroyOfflineTts() @@ -964,11 +967,19 @@ SherpaOnnxOfflineTtsGenerateWithCallback( const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioCallback callback); +SHERPA_ONNX_API const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithProgressCallback( const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, + SherpaOnnxGeneratedAudioProgressCallback callback); +SHERPA_ONNX_API +const SherpaOnnxGeneratedAudio * +SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg( + const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, + SherpaOnnxGeneratedAudioProgressCallbackWithArg callback, void *arg); + // Same as SherpaOnnxGeneratedAudioCallback but you can pass an additional // `void* arg` to the callback. SHERPA_ONNX_API const SherpaOnnxGeneratedAudio * diff --git a/sherpa-onnx/csrc/circular-buffer.cc b/sherpa-onnx/csrc/circular-buffer.cc index 2fd19cdfa..2ba81807b 100644 --- a/sherpa-onnx/csrc/circular-buffer.cc +++ b/sherpa-onnx/csrc/circular-buffer.cc @@ -22,8 +22,14 @@ CircularBuffer::CircularBuffer(int32_t capacity) { void CircularBuffer::Resize(int32_t new_capacity) { int32_t capacity = static_cast(buffer_.size()); if (new_capacity <= capacity) { +#if __OHOS__ + SHERPA_ONNX_LOGE( + "new_capacity (%{public}d) <= original capacity (%{public}d). Skip it.", + new_capacity, capacity); +#else SHERPA_ONNX_LOGE("new_capacity (%d) <= original capacity (%d). Skip it.", new_capacity, capacity); +#endif return; } @@ -90,10 +96,18 @@ void CircularBuffer::Push(const float *p, int32_t n) { int32_t size = Size(); if (n + size > capacity) { int32_t new_capacity = std::max(capacity * 2, n + size); +#if __OHOS__ + SHERPA_ONNX_LOGE( + "Overflow! n: %{public}d, size: %{public}d, n+size: %{public}d, " + "capacity: %{public}d. Increase " + "capacity to: %{public}d. (Original data is copied. No data loss!)", + n, size, n + size, capacity, new_capacity); +#else SHERPA_ONNX_LOGE( "Overflow! n: %d, size: %d, n+size: %d, capacity: %d. Increase " - "capacity to: %d", + "capacity to: %d. (Original data is copied. No data loss!)", n, size, n + size, capacity, new_capacity); +#endif Resize(new_capacity); capacity = new_capacity; diff --git a/sherpa-onnx/csrc/offline-tts-vits-impl.h b/sherpa-onnx/csrc/offline-tts-vits-impl.h index f86363d34..8bc85c8cd 100644 --- a/sherpa-onnx/csrc/offline-tts-vits-impl.h +++ b/sherpa-onnx/csrc/offline-tts-vits-impl.h @@ -282,7 +282,7 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { audio.samples.end()); if (callback) { should_continue = callback(audio.samples.data(), audio.samples.size(), - b * 1.0 / num_batches); + (b + 1) * 1.0 / num_batches); // Caution(fangjun): audio is freed when the callback returns, so users // should copy the data if they want to access the data after // the callback returns to avoid segmentation fault. From 1bc48c5cb59a5bc57c0ec7777f4d324edf2c30d7 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 4 Dec 2024 10:52:58 +0800 Subject: [PATCH 07/10] Show progress --- .../entry/src/main/ets/pages/Index.ets | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index debb106e6..ab3e3691e 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -58,6 +58,7 @@ struct Index { @State btnStopEnabled: boolean = false; @State btnSaveCaption: string = 'Save'; @State btnSaveEnabled: boolean = false; + @State progress: number = 0; private cancelled: boolean = false; @State isGenerating: boolean = false; @State initTtsDone: boolean = false; @@ -122,7 +123,7 @@ struct Index { console.log(`received msg from worker: ${msgType}`); if (msgType == 'init-tts-done') { - console.log('init tts done'); + this.info = 'Model initialized!\nPlease enter text and press start.'; this.sampleRate = e.data['sampleRate'] as number; this.numSpeakers = e.data['numSpeakers'] as number; @@ -136,7 +137,7 @@ struct Index { const samples: Float32Array = e.data['samples'] as Float32Array; const progress: number = e.data['progress'] as number; - console.log(`progress: ${progress}`); + this.progress = progress; this.sampleBuffer.push(samples); @@ -163,10 +164,14 @@ struct Index { const audioDuration = samples.length / this.sampleRate; const elapsedSeconds = (this.stopTime - this.startTime) / 1000; const RTF = elapsedSeconds / audioDuration; + this.info = `Audio duration: ${audioDuration} s Elapsed: ${elapsedSeconds} s RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3)} `; + if (this.cancelled) { + this.info += '\nCancelled.'; + } } }); @@ -178,6 +183,7 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 } } + this.info = 'Initializing TTS model ...'; this.workerInstance.postMessage({ msgType: 'init-tts', context: getContext() }); } @@ -188,13 +194,13 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 Row({ space: 10 }) { Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { - console.log(`input text is ${this.inputText}`); - if (this.workerInstance && this.initTtsDone) { + this.info = 'Generating...'; this.cancelled = false; this.finalSamples = null; this.sampleBuffer.reset(); this.ttsGeneratedDone = false; + this.progress = 0; this.btnStartEnabled = false; this.btnStopEnabled = true; @@ -205,6 +211,9 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.workerInstance.postMessage({ msgType: 'tts-generate', text: this.inputText }); this.isGenerating = true; this.info = ''; + } else { + this.info = 'Failed to initialize tts model'; + this.btnStartEnabled = false; } }); @@ -248,7 +257,17 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 } if (this.info != '') { - TextArea({ text: this.info }); + TextArea({ text: this.info }).focusable(false); + } + if (this.progress > 0) { + Row() { + Progress({ value: 0, total: 100, type: ProgressType.Capsule }) + .width('80%') + .height(20) + .value(this.progress * 100); + + Text(`${(this.progress * 100).toFixed(2)}%`).width('15%') + }.width('100%').justifyContent(FlexAlign.Center) } TextArea({ placeholder: 'Input text for TTS and click the start button' }) From cba39f3224e11b3b4d28070c9eea27379b9b9ec4 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 4 Dec 2024 11:17:33 +0800 Subject: [PATCH 08/10] add speaker ID --- .../entry/src/main/ets/pages/Index.ets | 49 ++++++++++++++++++- .../ets/workers/NonStreamingTtsWorker.ets | 4 +- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index ab3e3691e..3c56b42c1 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -59,6 +59,8 @@ struct Index { @State btnSaveCaption: string = 'Save'; @State btnSaveEnabled: boolean = false; @State progress: number = 0; + @State sid: string = '0'; + @State speechSpeed: string = '1.0'; private cancelled: boolean = false; @State isGenerating: boolean = false; @State initTtsDone: boolean = false; @@ -191,9 +193,49 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 Row() { Column({ space: 10 }) { Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); + if (this.numSpeakers > 1) { + Row({ space: 10 }) { + Text(`Speaker ID (0-${this.numSpeakers-1})`) + .width('60%') + + TextInput({ text: this.sid }) + .onChange((text) => { + this.sid = text.trim(); + }) + .width('20%') + }.justifyContent(FlexAlign.Center) + } + + Row() { + Text('Speech speed') + .width('60%'); + + TextInput({ text: this.speechSpeed }) + .onChange((text) => { + this.speechSpeed = text.trim(); + }) + .width('20%') + } Row({ space: 10 }) { Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { + let sid = parseInt(this.sid); + if (sid.toString() != this.sid) { + this.info = 'Please input a valid speaker ID'; + return; + } + + let speed = parseFloat(this.speechSpeed); + if (isNaN(speed)) { + this.info = 'Please enter a valid speech speed'; + return; + } + + if (speed <= 0) { + this.info = 'Please enter a positive speech speed'; + return; + } + if (this.workerInstance && this.initTtsDone) { this.info = 'Generating...'; this.cancelled = false; @@ -208,7 +250,12 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 console.log(`sending ${this.inputText}`) this.ttsGeneratedDone = false; this.startTime = await systemTime.getRealTime(); - this.workerInstance.postMessage({ msgType: 'tts-generate', text: this.inputText }); + this.workerInstance?.postMessage({ + msgType: 'tts-generate', + text: this.inputText, + sid: sid, + speed: speed, + }); this.isGenerating = true; this.info = ''; } else { diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index a278cf775..dc3cebc87 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -237,8 +237,8 @@ workerPort.onmessage = (e: MessageEvents) => { console.log(`recevied text ${text}`); const input: TtsInput = new TtsInput(); input.text = text; - input.sid = 0; - input.speed = 1.0; + input.sid = e.data['sid'] as number; + input.speed = e.data['speed'] as number; input.callback = callback; cancelled = false; From 945a42eca1896da49934c594a2b27235f057a2ad Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 4 Dec 2024 12:23:48 +0800 Subject: [PATCH 09/10] first working version --- .../entry/src/main/ets/pages/Index.ets | 22 +++- .../ets/workers/NonStreamingTtsWorker.ets | 30 +++-- sherpa-onnx/csrc/melo-tts-lexicon.cc | 118 +++++++++++++++++- sherpa-onnx/csrc/melo-tts-lexicon.h | 10 ++ sherpa-onnx/csrc/offline-tts-vits-impl.h | 14 +++ 5 files changed, 179 insertions(+), 15 deletions(-) diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 3c56b42c1..0068730b9 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -84,6 +84,7 @@ struct Index { console.log(`Audio renderer has already been created. Skip creating`); return; } // see // https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/using-audiorenderer-for-playback-V5 + console.log('Initializing audio renderer'); const audioStreamInfo: audio.AudioStreamInfo = { samplingRate: this.sampleRate, channels: audio.AudioChannel.CHANNEL_1, // 通道 @@ -112,11 +113,15 @@ struct Index { } else { console.log(`returned audio renderer is ${renderer}`); } + } else { + console.log(`Failed to initialize audio renderer. error message: ${err.message}, error code: ${err.code}`); } }); } async aboutToAppear() { + this.initAudioRenderer(); + this.workerInstance = new worker.ThreadWorker(this.scriptURL, { name: 'NonStreaming TTS worker' }); @@ -182,6 +187,21 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.btnSaveEnabled = true; this.ttsGeneratedDone = true; + + console.log(`buffer size ${this.sampleBuffer.size()}`); + + if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING && this.sampleBuffer.size()==0) { + console.log(`here buffer size ${this.sampleBuffer.size()}`); + this.sampleBuffer.push(samples); + this.progress = 1; + this.audioRenderer.start(); + } + + if (!this.initAudioDone) { + this.btnStartEnabled = true; + this.btnStopEnabled = false; + this.info += '\nAudio renderer is not initialized. Disable playing audio.'; + } } } @@ -320,7 +340,7 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 TextArea({ placeholder: 'Input text for TTS and click the start button' }) .width('100%') .height('100%') - .focusable(this.isGenerating == false) + .focusable(this.isGenerating == false && this.initTtsDone) .onChange((text) => { this.inputText = text; if (text.trim() == '') { diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets index dc3cebc87..bd5c7a5b8 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/workers/NonStreamingTtsWorker.ets @@ -94,16 +94,16 @@ function initTts(context: Context): OfflineTts { // Example 2: // https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 - modelDir = 'vits-piper-en_US-amy-low'; - modelName = 'en_US-amy-low.onnx'; - dataDir = 'espeak-ng-data'; + // modelDir = 'vits-piper-en_US-amy-low'; + // modelName = 'en_US-amy-low.onnx'; + // dataDir = 'espeak-ng-data'; // Example 3: // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2 // modelDir = 'vits-icefall-zh-aishell3'; // modelName = 'model.onnx'; - // ruleFsts = 'vits-icefall-zh-aishell3/phone.fst,vits-icefall-zh-aishell3/date.fst,vits-icefall-zh-aishell3/number.fst,vits-icefall-zh-aishell3/new_heteronym.fst'; - // ruleFars = 'vits-icefall-zh-aishell3/rule.far'; + // ruleFsts = 'phone.fst,date.fst,number.fst,new_heteronym.fst'; + // ruleFars = 'rule.far'; // lexicon = 'lexicon.txt'; // Example 4: @@ -111,7 +111,7 @@ function initTts(context: Context): OfflineTts { // modelDir = 'vits-zh-hf-fanchen-C'; // modelName = 'vits-zh-hf-fanchen-C.onnx'; // lexicon = 'lexicon.txt'; - // dictDir = 'vits-zh-hf-fanchen-C/dict'; + // dictDir = 'dict'; // Example 5: // https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-coqui-de-css10.tar.bz2 @@ -131,7 +131,8 @@ function initTts(context: Context): OfflineTts { // modelDir = 'vits-melo-tts-zh_en'; // modelName = 'model.onnx'; // lexicon = 'lexicon.txt'; - // dictDir = 'vits-melo-tts-zh_en/dict'; + // dictDir = 'dict'; + // ruleFsts = `date.fst,phone.fst,number.fst`; // ============================================================ // Please don't change the remaining part of this function @@ -242,15 +243,24 @@ workerPort.onmessage = (e: MessageEvents) => { input.callback = callback; cancelled = false; - tts.generateAsync(input).then((ttsOutput: TtsOutput) => { - console.log(`sampleRate: ${ttsOutput.sampleRate}`); + if (true) { + tts.generateAsync(input).then((ttsOutput: TtsOutput) => { + console.log(`sampleRate: ${ttsOutput.sampleRate}`); + + workerPort.postMessage({ + 'msgType': 'tts-generate-done', + samples: Float32Array.from(ttsOutput.samples), + }); + }); + } else { + const ttsOutput: TtsOutput = tts.generate(input); workerPort.postMessage({ 'msgType': 'tts-generate-done', samples: Float32Array.from(ttsOutput.samples), }); + } - }); } } diff --git a/sherpa-onnx/csrc/melo-tts-lexicon.cc b/sherpa-onnx/csrc/melo-tts-lexicon.cc index 29857824f..ec729cdb5 100644 --- a/sherpa-onnx/csrc/melo-tts-lexicon.cc +++ b/sherpa-onnx/csrc/melo-tts-lexicon.cc @@ -6,11 +6,21 @@ #include #include // NOLINT +#include #include +#if __ANDROID_API__ >= 9 +#include "android/asset_manager.h" +#include "android/asset_manager_jni.h" +#endif + +#if __OHOS__ +#include "rawfile/raw_file_manager.h" +#endif #include "cppjieba/Jieba.hpp" #include "sherpa-onnx/csrc/file-utils.h" #include "sherpa-onnx/csrc/macros.h" +#include "sherpa-onnx/csrc/onnx-utils.h" #include "sherpa-onnx/csrc/symbol-table.h" #include "sherpa-onnx/csrc/text-utils.h" @@ -62,6 +72,60 @@ class MeloTtsLexicon::Impl { } } + template + Impl(Manager *mgr, const std::string &lexicon, const std::string &tokens, + const std::string &dict_dir, + const OfflineTtsVitsModelMetaData &meta_data, bool debug) + : meta_data_(meta_data), debug_(debug) { + std::string dict = dict_dir + "/jieba.dict.utf8"; + std::string hmm = dict_dir + "/hmm_model.utf8"; + std::string user_dict = dict_dir + "/user.dict.utf8"; + std::string idf = dict_dir + "/idf.utf8"; + std::string stop_word = dict_dir + "/stop_words.utf8"; + + AssertFileExists(dict); + AssertFileExists(hmm); + AssertFileExists(user_dict); + AssertFileExists(idf); + AssertFileExists(stop_word); + + jieba_ = + std::make_unique(dict, hmm, user_dict, idf, stop_word); + + { + auto buf = ReadFile(mgr, tokens); + + std::istrstream is(buf.data(), buf.size()); + InitTokens(is); + } + + { + auto buf = ReadFile(mgr, lexicon); + + std::istrstream is(buf.data(), buf.size()); + InitLexicon(is); + } + } + + template + Impl(Manager *mgr, const std::string &lexicon, const std::string &tokens, + const OfflineTtsVitsModelMetaData &meta_data, bool debug) + : meta_data_(meta_data), debug_(debug) { + { + auto buf = ReadFile(mgr, tokens); + + std::istrstream is(buf.data(), buf.size()); + InitTokens(is); + } + + { + auto buf = ReadFile(mgr, lexicon); + + std::istrstream is(buf.data(), buf.size()); + InitLexicon(is); + } + } + std::vector ConvertTextToTokenIds(const std::string &_text) const { std::string text = ToLowerCase(_text); // see @@ -84,17 +148,24 @@ class MeloTtsLexicon::Impl { jieba_->Cut(text, words, is_hmm); if (debug_) { - SHERPA_ONNX_LOGE("input text: %s", text.c_str()); - SHERPA_ONNX_LOGE("after replacing punctuations: %s", s.c_str()); - std::ostringstream os; std::string sep = ""; for (const auto &w : words) { os << sep << w; sep = "_"; } +#if __OHOS__ + SHERPA_ONNX_LOGE("input text: %{public}s", text.c_str()); + SHERPA_ONNX_LOGE("after replacing punctuations: %{public}s", s.c_str()); + + SHERPA_ONNX_LOGE("after jieba processing: %{public}s", + os.str().c_str()); +#else + SHERPA_ONNX_LOGE("input text: %s", text.c_str()); + SHERPA_ONNX_LOGE("after replacing punctuations: %s", s.c_str()); SHERPA_ONNX_LOGE("after jieba processing: %s", os.str().c_str()); +#endif } } else { words = SplitUtf8(text); @@ -102,7 +173,7 @@ class MeloTtsLexicon::Impl { if (debug_) { fprintf(stderr, "Input text in string (lowercase): %s\n", text.c_str()); fprintf(stderr, "Input text in bytes (lowercase):"); - for (uint8_t c : text) { + for (int8_t c : text) { fprintf(stderr, " %02x", c); } fprintf(stderr, "\n"); @@ -307,9 +378,48 @@ MeloTtsLexicon::MeloTtsLexicon(const std::string &lexicon, bool debug) : impl_(std::make_unique(lexicon, tokens, meta_data, debug)) {} +template +MeloTtsLexicon::MeloTtsLexicon(Manager *mgr, const std::string &lexicon, + const std::string &tokens, + const std::string &dict_dir, + const OfflineTtsVitsModelMetaData &meta_data, + bool debug) + : impl_(std::make_unique(mgr, lexicon, tokens, dict_dir, meta_data, + debug)) {} + +template +MeloTtsLexicon::MeloTtsLexicon(Manager *mgr, const std::string &lexicon, + const std::string &tokens, + const OfflineTtsVitsModelMetaData &meta_data, + bool debug) + : impl_(std::make_unique(mgr, lexicon, tokens, meta_data, debug)) {} + std::vector MeloTtsLexicon::ConvertTextToTokenIds( const std::string &text, const std::string & /*unused_voice = ""*/) const { return impl_->ConvertTextToTokenIds(text); } +#if __ANDROID_API__ >= 9 +template MeloTtsLexicon::MeloTtsLexicon( + AAssetManager *mgr, const std::string &lexicon, const std::string &tokens, + const std::string &dict_dir, const OfflineTtsVitsModelMetaData &meta_data, + bool debug); + +template MeloTtsLexicon::MeloTtsLexicon( + AAssetManager *mgr, const std::string &lexicon, const std::string &tokens, + const OfflineTtsVitsModelMetaData &meta_data, bool debug); +#endif + +#if __OHOS__ +template MeloTtsLexicon::MeloTtsLexicon( + NativeResourceManager *mgr, const std::string &lexicon, + const std::string &tokens, const std::string &dict_dir, + const OfflineTtsVitsModelMetaData &meta_data, bool debug); + +template MeloTtsLexicon::MeloTtsLexicon( + NativeResourceManager *mgr, const std::string &lexicon, + const std::string &tokens, const OfflineTtsVitsModelMetaData &meta_data, + bool debug); +#endif + } // namespace sherpa_onnx diff --git a/sherpa-onnx/csrc/melo-tts-lexicon.h b/sherpa-onnx/csrc/melo-tts-lexicon.h index da0644be2..e91cf33f2 100644 --- a/sherpa-onnx/csrc/melo-tts-lexicon.h +++ b/sherpa-onnx/csrc/melo-tts-lexicon.h @@ -25,6 +25,16 @@ class MeloTtsLexicon : public OfflineTtsFrontend { MeloTtsLexicon(const std::string &lexicon, const std::string &tokens, const OfflineTtsVitsModelMetaData &meta_data, bool debug); + template + MeloTtsLexicon(Manager *mgr, const std::string &lexicon, + const std::string &tokens, const std::string &dict_dir, + const OfflineTtsVitsModelMetaData &meta_data, bool debug); + + template + MeloTtsLexicon(Manager *mgr, const std::string &lexicon, + const std::string &tokens, + const OfflineTtsVitsModelMetaData &meta_data, bool debug); + std::vector ConvertTextToTokenIds( const std::string &text, const std::string &unused_voice = "") const override; diff --git a/sherpa-onnx/csrc/offline-tts-vits-impl.h b/sherpa-onnx/csrc/offline-tts-vits-impl.h index 8bc85c8cd..5ef79f69b 100644 --- a/sherpa-onnx/csrc/offline-tts-vits-impl.h +++ b/sherpa-onnx/csrc/offline-tts-vits-impl.h @@ -183,7 +183,11 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { for (const auto &tn : tn_list_) { text = tn->Normalize(text); if (config_.model.debug) { +#if __OHOS__ + SHERPA_ONNX_LOGE("After normalizing: %{public}s", text.c_str()); +#else SHERPA_ONNX_LOGE("After normalizing: %s", text.c_str()); +#endif } } } @@ -324,6 +328,16 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { if (meta_data.frontend == "characters") { frontend_ = std::make_unique( mgr, config_.model.vits.tokens, meta_data); + } else if (meta_data.jieba && !config_.model.vits.dict_dir.empty() && + meta_data.is_melo_tts) { + frontend_ = std::make_unique( + mgr, config_.model.vits.lexicon, config_.model.vits.tokens, + config_.model.vits.dict_dir, model_->GetMetaData(), + config_.model.debug); + } else if (meta_data.is_melo_tts && meta_data.language == "English") { + frontend_ = std::make_unique( + mgr, config_.model.vits.lexicon, config_.model.vits.tokens, + model_->GetMetaData(), config_.model.debug); } else if ((meta_data.is_piper || meta_data.is_coqui || meta_data.is_icefall) && !config_.model.vits.data_dir.empty()) { From 0cef3c60ecfa519ca947842cec05bd08be0184d7 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 4 Dec 2024 14:23:02 +0800 Subject: [PATCH 10/10] Change app name --- .../src/main/cpp/non-streaming-tts.cc | 841 ++++++++++-------- .../sherpa_onnx/src/main/cpp/utils.cc | 2 +- .../SherpaOnnxTts/entry/oh-package-lock.json5 | 15 +- .../SherpaOnnxTts/entry/oh-package.json5 | 3 +- .../entry/src/main/ets/pages/Index.ets | 287 +++--- .../main/resources/base/element/string.json | 4 +- .../src/main/resources/base/media/home.svg | 1 + .../src/main/resources/base/media/info.svg | 1 + .../main/resources/en_US/element/string.json | 6 +- .../main/resources/zh_CN/element/string.json | 6 +- .../entry/src/main/ets/pages/Index.ets | 148 ++- .../main/resources/base/element/string.json | 8 +- .../main/resources/en_US/element/string.json | 10 +- .../main/resources/zh_CN/element/string.json | 10 +- 14 files changed, 717 insertions(+), 625 deletions(-) create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/home.svg create mode 100644 harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/info.svg diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc index 45f9fe40c..67f348e9b 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/non-streaming-tts.cc @@ -5,542 +5,599 @@ #include #include -#include "macros.h" // NOLINT -#include "napi.h" // NOLINT +#include "macros.h" // NOLINT +#include "napi.h" // NOLINT #include "sherpa-onnx/c-api/c-api.h" +static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig( + Napi::Object obj) { + SherpaOnnxOfflineTtsVitsModelConfig c; + memset(&c, 0, sizeof(c)); -static SherpaOnnxOfflineTtsVitsModelConfig GetOfflineTtsVitsModelConfig(Napi::Object obj) { - SherpaOnnxOfflineTtsVitsModelConfig c; - memset(&c, 0, sizeof(c)); - - if (!obj.Has("vits") || !obj.Get("vits").IsObject()) { - return c; - } - - Napi::Object o = obj.Get("vits").As(); - SHERPA_ONNX_ASSIGN_ATTR_STR(model, model); - SHERPA_ONNX_ASSIGN_ATTR_STR(lexicon, lexicon); - SHERPA_ONNX_ASSIGN_ATTR_STR(tokens, tokens); - SHERPA_ONNX_ASSIGN_ATTR_STR(data_dir, dataDir); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale, noiseScale); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale_w, noiseScaleW); - SHERPA_ONNX_ASSIGN_ATTR_FLOAT(length_scale, lengthScale); - SHERPA_ONNX_ASSIGN_ATTR_STR(dict_dir, dictDir); - + if (!obj.Has("vits") || !obj.Get("vits").IsObject()) { return c; + } + + Napi::Object o = obj.Get("vits").As(); + SHERPA_ONNX_ASSIGN_ATTR_STR(model, model); + SHERPA_ONNX_ASSIGN_ATTR_STR(lexicon, lexicon); + SHERPA_ONNX_ASSIGN_ATTR_STR(tokens, tokens); + SHERPA_ONNX_ASSIGN_ATTR_STR(data_dir, dataDir); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale, noiseScale); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(noise_scale_w, noiseScaleW); + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(length_scale, lengthScale); + SHERPA_ONNX_ASSIGN_ATTR_STR(dict_dir, dictDir); + + return c; } -static SherpaOnnxOfflineTtsModelConfig GetOfflineTtsModelConfig(Napi::Object obj) { - SherpaOnnxOfflineTtsModelConfig c; - memset(&c, 0, sizeof(c)); +static SherpaOnnxOfflineTtsModelConfig GetOfflineTtsModelConfig( + Napi::Object obj) { + SherpaOnnxOfflineTtsModelConfig c; + memset(&c, 0, sizeof(c)); - if (!obj.Has("model") || !obj.Get("model").IsObject()) { - return c; - } + if (!obj.Has("model") || !obj.Get("model").IsObject()) { + return c; + } - Napi::Object o = obj.Get("model").As(); + Napi::Object o = obj.Get("model").As(); - c.vits = GetOfflineTtsVitsModelConfig(o); + c.vits = GetOfflineTtsVitsModelConfig(o); - SHERPA_ONNX_ASSIGN_ATTR_INT32(num_threads, numThreads); + SHERPA_ONNX_ASSIGN_ATTR_INT32(num_threads, numThreads); - if (o.Has("debug") && (o.Get("debug").IsNumber() || o.Get("debug").IsBoolean())) { - if (o.Get("debug").IsBoolean()) { - c.debug = o.Get("debug").As().Value(); - } else { - c.debug = o.Get("debug").As().Int32Value(); - } + if (o.Has("debug") && + (o.Get("debug").IsNumber() || o.Get("debug").IsBoolean())) { + if (o.Get("debug").IsBoolean()) { + c.debug = o.Get("debug").As().Value(); + } else { + c.debug = o.Get("debug").As().Int32Value(); } + } - SHERPA_ONNX_ASSIGN_ATTR_STR(provider, provider); + SHERPA_ONNX_ASSIGN_ATTR_STR(provider, provider); - return c; + return c; } -static Napi::External CreateOfflineTtsWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::External CreateOfflineTtsWrapper( + const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); #if __OHOS__ - // the last argument is the NativeResourceManager - if (info.Length() != 2) { - std::ostringstream os; - os << "Expect only 2 arguments. Given: " << info.Length(); + // the last argument is the NativeResourceManager + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } #else - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } #endif - if (!info[0].IsObject()) { - Napi::TypeError::New(env, "Expect an object as the argument").ThrowAsJavaScriptException(); + if (!info[0].IsObject()) { + Napi::TypeError::New(env, "Expect an object as the argument") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - Napi::Object o = info[0].As(); + Napi::Object o = info[0].As(); - SherpaOnnxOfflineTtsConfig c; - memset(&c, 0, sizeof(c)); + SherpaOnnxOfflineTtsConfig c; + memset(&c, 0, sizeof(c)); - c.model = GetOfflineTtsModelConfig(o); + c.model = GetOfflineTtsModelConfig(o); - SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts); - SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences); - SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars); + SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts); + SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences); + SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars); #if __OHOS__ - std::unique_ptr mgr( - OH_ResourceManager_InitNativeResourceManager(env, info[1]), &OH_ResourceManager_ReleaseNativeResourceManager); - SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTtsOHOS(&c, mgr.get()); + std::unique_ptr + mgr(OH_ResourceManager_InitNativeResourceManager(env, info[1]), + &OH_ResourceManager_ReleaseNativeResourceManager); + SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTtsOHOS(&c, mgr.get()); #else - SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTts(&c); + SherpaOnnxOfflineTts *tts = SherpaOnnxCreateOfflineTts(&c); #endif - if (c.model.vits.model) { - delete[] c.model.vits.model; - } + if (c.model.vits.model) { + delete[] c.model.vits.model; + } - if (c.model.vits.lexicon) { - delete[] c.model.vits.lexicon; - } + if (c.model.vits.lexicon) { + delete[] c.model.vits.lexicon; + } - if (c.model.vits.tokens) { - delete[] c.model.vits.tokens; - } + if (c.model.vits.tokens) { + delete[] c.model.vits.tokens; + } - if (c.model.vits.data_dir) { - delete[] c.model.vits.data_dir; - } + if (c.model.vits.data_dir) { + delete[] c.model.vits.data_dir; + } - if (c.model.vits.dict_dir) { - delete[] c.model.vits.dict_dir; - } + if (c.model.vits.dict_dir) { + delete[] c.model.vits.dict_dir; + } - if (c.model.provider) { - delete[] c.model.provider; - } + if (c.model.provider) { + delete[] c.model.provider; + } - if (c.rule_fsts) { - delete[] c.rule_fsts; - } + if (c.rule_fsts) { + delete[] c.rule_fsts; + } - if (c.rule_fars) { - delete[] c.rule_fars; - } + if (c.rule_fars) { + delete[] c.rule_fars; + } - if (!tts) { - Napi::TypeError::New(env, "Please check your config!").ThrowAsJavaScriptException(); + if (!tts) { + Napi::TypeError::New(env, "Please check your config!") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - return Napi::External::New( - env, tts, [](Napi::Env env, SherpaOnnxOfflineTts *tts) { SherpaOnnxDestroyOfflineTts(tts); }); + return Napi::External::New( + env, tts, [](Napi::Env env, SherpaOnnxOfflineTts *tts) { + SherpaOnnxDestroyOfflineTts(tts); + }); } -static Napi::Number OfflineTtsSampleRateWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::Number OfflineTtsSampleRateWrapper( + const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = + info[0].As>().Data(); - int32_t sample_rate = SherpaOnnxOfflineTtsSampleRate(tts); + int32_t sample_rate = SherpaOnnxOfflineTtsSampleRate(tts); - return Napi::Number::New(env, sample_rate); + return Napi::Number::New(env, sample_rate); } -static Napi::Number OfflineTtsNumSpeakersWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::Number OfflineTtsNumSpeakersWrapper( + const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); - if (info.Length() != 1) { - std::ostringstream os; - os << "Expect only 1 argument. Given: " << info.Length(); + if (info.Length() != 1) { + std::ostringstream os; + os << "Expect only 1 argument. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = + info[0].As>().Data(); - int32_t num_speakers = SherpaOnnxOfflineTtsNumSpeakers(tts); + int32_t num_speakers = SherpaOnnxOfflineTtsNumSpeakers(tts); - return Napi::Number::New(env, num_speakers); + return Napi::Number::New(env, num_speakers); } // synchronous version static Napi::Object OfflineTtsGenerateWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); + Napi::Env env = info.Env(); - if (info.Length() != 2) { - std::ostringstream os; - os << "Expect only 2 arguments. Given: " << info.Length(); + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = + info[0].As>().Data(); - if (!info[1].IsObject()) { - Napi::TypeError::New(env, "Argument 1 should be an object").ThrowAsJavaScriptException(); + if (!info[1].IsObject()) { + Napi::TypeError::New(env, "Argument 1 should be an object") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - Napi::Object obj = info[1].As(); + Napi::Object obj = info[1].As(); - if (!obj.Has("text")) { - Napi::TypeError::New(env, "The argument object should have a field text").ThrowAsJavaScriptException(); + if (!obj.Has("text")) { + Napi::TypeError::New(env, "The argument object should have a field text") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("text").IsString()) { - Napi::TypeError::New(env, "The object['text'] should be a string").ThrowAsJavaScriptException(); + if (!obj.Get("text").IsString()) { + Napi::TypeError::New(env, "The object['text'] should be a string") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Has("sid")) { - Napi::TypeError::New(env, "The argument object should have a field sid").ThrowAsJavaScriptException(); + if (!obj.Has("sid")) { + Napi::TypeError::New(env, "The argument object should have a field sid") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("sid").IsNumber()) { - Napi::TypeError::New(env, "The object['sid'] should be a number").ThrowAsJavaScriptException(); + if (!obj.Get("sid").IsNumber()) { + Napi::TypeError::New(env, "The object['sid'] should be a number") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Has("speed")) { - Napi::TypeError::New(env, "The argument object should have a field speed").ThrowAsJavaScriptException(); + if (!obj.Has("speed")) { + Napi::TypeError::New(env, "The argument object should have a field speed") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("speed").IsNumber()) { - Napi::TypeError::New(env, "The object['speed'] should be a number").ThrowAsJavaScriptException(); + if (!obj.Get("speed").IsNumber()) { + Napi::TypeError::New(env, "The object['speed'] should be a number") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - bool enable_external_buffer = true; - if (obj.Has("enableExternalBuffer") && obj.Get("enableExternalBuffer").IsBoolean()) { - enable_external_buffer = obj.Get("enableExternalBuffer").As().Value(); - } + bool enable_external_buffer = true; + if (obj.Has("enableExternalBuffer") && + obj.Get("enableExternalBuffer").IsBoolean()) { + enable_external_buffer = + obj.Get("enableExternalBuffer").As().Value(); + } - Napi::String _text = obj.Get("text").As(); - std::string text = _text.Utf8Value(); - int32_t sid = obj.Get("sid").As().Int32Value(); - float speed = obj.Get("speed").As().FloatValue(); - - const SherpaOnnxGeneratedAudio *audio; - audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); - - if (enable_external_buffer) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( - env, const_cast(audio->samples), sizeof(float) * audio->n, - [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { - SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); - }, - audio); - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); - - Napi::Object ans = Napi::Object::New(env); - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); - return ans; - } else { - // don't use external buffer - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio->n); + Napi::String _text = obj.Get("text").As(); + std::string text = _text.Utf8Value(); + int32_t sid = obj.Get("sid").As().Int32Value(); + float speed = obj.Get("speed").As().FloatValue(); - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); + const SherpaOnnxGeneratedAudio *audio; + audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, speed); - std::copy(audio->samples, audio->samples + audio->n, float32Array.Data()); + if (enable_external_buffer) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( + env, const_cast(audio->samples), sizeof(float) * audio->n, + [](Napi::Env /*env*/, void * /*data*/, + const SherpaOnnxGeneratedAudio *hint) { + SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); + }, + audio); + Napi::Float32Array float32Array = + Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); - Napi::Object ans = Napi::Object::New(env); - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); - SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio); - return ans; - } + Napi::Object ans = Napi::Object::New(env); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); + return ans; + } else { + // don't use external buffer + Napi::ArrayBuffer arrayBuffer = + Napi::ArrayBuffer::New(env, sizeof(float) * audio->n); + + Napi::Float32Array float32Array = + Napi::Float32Array::New(env, audio->n, arrayBuffer, 0); + + std::copy(audio->samples, audio->samples + audio->n, float32Array.Data()); + + Napi::Object ans = Napi::Object::New(env); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio->sample_rate); + SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio); + return ans; + } } struct TtsCallbackData { - std::vector samples; - float progress; - bool processed = false; - bool cancelled = false; + std::vector samples; + float progress; + bool processed = false; + bool cancelled = false; }; // see // https://github.com/nodejs/node-addon-examples/blob/main/src/6-threadsafe-function/typed_threadsafe_function/node-addon-api/clock.cc -void InvokeJsCallback(Napi::Env env, Napi::Function callback, Napi::Reference* context, - TtsCallbackData *data) { - if (env != nullptr) { - if (callback != nullptr) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * data->samples.size()); - - Napi::Float32Array float32Array = Napi::Float32Array::New(env, data->samples.size(), arrayBuffer, 0); - - std::copy(data->samples.begin(), data->samples.end(), float32Array.Data()); - - Napi::Object arg = Napi::Object::New(env); - arg.Set(Napi::String::New(env, "samples"), float32Array); - arg.Set(Napi::String::New(env, "progress"), data->progress); - - auto v = callback.Call(context->Value(), {arg}); - data->processed = true; - if (v.IsNumber() && v.As().Int32Value()) { - data->cancelled = false; - } else { - data->cancelled = true; - } - } - } +void InvokeJsCallback(Napi::Env env, Napi::Function callback, + Napi::Reference *context, + TtsCallbackData *data) { + if (env != nullptr) { + if (callback != nullptr) { + Napi::ArrayBuffer arrayBuffer = + Napi::ArrayBuffer::New(env, sizeof(float) * data->samples.size()); + + Napi::Float32Array float32Array = + Napi::Float32Array::New(env, data->samples.size(), arrayBuffer, 0); + + std::copy(data->samples.begin(), data->samples.end(), + float32Array.Data()); + + Napi::Object arg = Napi::Object::New(env); + arg.Set(Napi::String::New(env, "samples"), float32Array); + arg.Set(Napi::String::New(env, "progress"), data->progress); + + auto v = callback.Call(context->Value(), {arg}); + data->processed = true; + if (v.IsNumber() && v.As().Int32Value()) { + data->cancelled = false; + } else { + data->cancelled = true; + } + } + } } -using TSFN = Napi::TypedThreadSafeFunction, TtsCallbackData, InvokeJsCallback>; +using TSFN = Napi::TypedThreadSafeFunction, + TtsCallbackData, InvokeJsCallback>; class TtsGenerateWorker : public Napi::AsyncWorker { -public: - TtsGenerateWorker(const Napi::Env &env, TSFN tsfn, SherpaOnnxOfflineTts *tts, const std::string &text, float speed, - int32_t sid, bool use_external_buffer) - :tsfn_(tsfn), Napi::AsyncWorker{env, "TtsGenerateWorker"}, deferred_(env), tts_(tts), text_(text), speed_(speed), sid_(sid), - use_external_buffer_(use_external_buffer) {} - - Napi::Promise Promise() { return deferred_.Promise(); } - - ~TtsGenerateWorker() { - OH_LOG_INFO(LOG_APP, "destroyed"); - int i = 0; - for (auto d: data_list_) { - OH_LOG_INFO(LOG_APP, " %{public}d", i); - i++; - delete d; + public: + TtsGenerateWorker(const Napi::Env &env, TSFN tsfn, SherpaOnnxOfflineTts *tts, + const std::string &text, float speed, int32_t sid, + bool use_external_buffer) + : tsfn_(tsfn), + Napi::AsyncWorker{env, "TtsGenerateWorker"}, + deferred_(env), + tts_(tts), + text_(text), + speed_(speed), + sid_(sid), + use_external_buffer_(use_external_buffer) {} + + Napi::Promise Promise() { return deferred_.Promise(); } + + ~TtsGenerateWorker() { + for (auto d : data_list_) { + delete d; + } + } + + protected: + void Execute() override { + auto callback = [](const float *samples, int32_t n, float progress, + void *arg) -> int32_t { + TtsGenerateWorker *_this = reinterpret_cast(arg); + + for (auto d : _this->data_list_) { + if (d->cancelled) { + OH_LOG_INFO(LOG_APP, "TtsGenerate is cancelled"); + return 0; } - } + } + + auto data = new TtsCallbackData; + data->samples = std::vector{samples, samples + n}; + data->progress = progress; + _this->data_list_.push_back(data); + + _this->tsfn_.NonBlockingCall(data); + + return 1; + }; + audio_ = SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg( + tts_, text_.c_str(), sid_, speed_, callback, this); + + tsfn_.Release(); + } + + void OnOK() override { + Napi::Env env = deferred_.Env(); + Napi::Object ans = Napi::Object::New(env); + if (use_external_buffer_) { + Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( + env, const_cast(audio_->samples), sizeof(float) * audio_->n, + [](Napi::Env /*env*/, void * /*data*/, + const SherpaOnnxGeneratedAudio *hint) { + SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); + }, + audio_); + Napi::Float32Array float32Array = + Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); + + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + } else { + // don't use external buffer + Napi::ArrayBuffer arrayBuffer = + Napi::ArrayBuffer::New(env, sizeof(float) * audio_->n); -protected: - void Execute() override { - auto callback = [] (const float* samples, int32_t n, float progress, void* arg)-> int32_t { - TtsGenerateWorker* _this = reinterpret_cast(arg); - - for (auto d: _this->data_list_) { - if (d->cancelled) { - OH_LOG_INFO(LOG_APP, "TtsGenerate is cancelled"); - return 0; - } - } - - auto data = new TtsCallbackData; - data->samples = std::vector{samples, samples + n}; - data->progress = progress; - _this->data_list_.push_back(data); - - _this->tsfn_.NonBlockingCall(data); - - return 1; - }; - audio_ = SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg(tts_, text_.c_str(), sid_, speed_, callback, this); - - tsfn_.Release(); - } + Napi::Float32Array float32Array = + Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); - void OnOK() override { - Napi::Env env = deferred_.Env(); - Napi::Object ans = Napi::Object::New(env); - if (use_external_buffer_) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New( - env, const_cast(audio_->samples), sizeof(float) * audio_->n, - [](Napi::Env /*env*/, void * /*data*/, const SherpaOnnxGeneratedAudio *hint) { - SherpaOnnxDestroyOfflineTtsGeneratedAudio(hint); - }, - audio_); - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); - - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); - } else { - // don't use external buffer - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, sizeof(float) * audio_->n); - - Napi::Float32Array float32Array = Napi::Float32Array::New(env, audio_->n, arrayBuffer, 0); - - std::copy(audio_->samples, audio_->samples + audio_->n, float32Array.Data()); - - ans.Set(Napi::String::New(env, "samples"), float32Array); - ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); - SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio_); - } + std::copy(audio_->samples, audio_->samples + audio_->n, + float32Array.Data()); - deferred_.Resolve(ans); + ans.Set(Napi::String::New(env, "samples"), float32Array); + ans.Set(Napi::String::New(env, "sampleRate"), audio_->sample_rate); + SherpaOnnxDestroyOfflineTtsGeneratedAudio(audio_); } -private: - TSFN tsfn_; - Napi::Promise::Deferred deferred_; - SherpaOnnxOfflineTts *tts_; - std::string text_; - float speed_; - int32_t sid_; - bool use_external_buffer_; - - const SherpaOnnxGeneratedAudio *audio_; - - std::vector data_list_; + deferred_.Resolve(ans); + } + + private: + TSFN tsfn_; + Napi::Promise::Deferred deferred_; + SherpaOnnxOfflineTts *tts_; + std::string text_; + float speed_; + int32_t sid_; + bool use_external_buffer_; + + const SherpaOnnxGeneratedAudio *audio_; + + std::vector data_list_; }; -static Napi::Object OfflineTtsGenerateAsyncWrapper(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); +static Napi::Object OfflineTtsGenerateAsyncWrapper( + const Napi::CallbackInfo &info) { + Napi::Env env = info.Env(); - if (info.Length() != 2) { - std::ostringstream os; - os << "Expect only 2 arguments. Given: " << info.Length(); + if (info.Length() != 2) { + std::ostringstream os; + os << "Expect only 2 arguments. Given: " << info.Length(); - Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); + Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!info[0].IsExternal()) { - Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.").ThrowAsJavaScriptException(); + if (!info[0].IsExternal()) { + Napi::TypeError::New(env, "Argument 0 should be an offline tts pointer.") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - SherpaOnnxOfflineTts *tts = info[0].As>().Data(); + SherpaOnnxOfflineTts *tts = + info[0].As>().Data(); - if (!info[1].IsObject()) { - Napi::TypeError::New(env, "Argument 1 should be an object").ThrowAsJavaScriptException(); + if (!info[1].IsObject()) { + Napi::TypeError::New(env, "Argument 1 should be an object") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - Napi::Object obj = info[1].As(); + Napi::Object obj = info[1].As(); - if (!obj.Has("text")) { - Napi::TypeError::New(env, "The argument object should have a field text").ThrowAsJavaScriptException(); + if (!obj.Has("text")) { + Napi::TypeError::New(env, "The argument object should have a field text") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("text").IsString()) { - Napi::TypeError::New(env, "The object['text'] should be a string").ThrowAsJavaScriptException(); + if (!obj.Get("text").IsString()) { + Napi::TypeError::New(env, "The object['text'] should be a string") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Has("sid")) { - Napi::TypeError::New(env, "The argument object should have a field sid").ThrowAsJavaScriptException(); + if (!obj.Has("sid")) { + Napi::TypeError::New(env, "The argument object should have a field sid") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("sid").IsNumber()) { - Napi::TypeError::New(env, "The object['sid'] should be a number").ThrowAsJavaScriptException(); + if (!obj.Get("sid").IsNumber()) { + Napi::TypeError::New(env, "The object['sid'] should be a number") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Has("speed")) { - Napi::TypeError::New(env, "The argument object should have a field speed").ThrowAsJavaScriptException(); + if (!obj.Has("speed")) { + Napi::TypeError::New(env, "The argument object should have a field speed") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - if (!obj.Get("speed").IsNumber()) { - Napi::TypeError::New(env, "The object['speed'] should be a number").ThrowAsJavaScriptException(); + if (!obj.Get("speed").IsNumber()) { + Napi::TypeError::New(env, "The object['speed'] should be a number") + .ThrowAsJavaScriptException(); - return {}; - } + return {}; + } - bool enable_external_buffer = true; - if (obj.Has("enableExternalBuffer") && obj.Get("enableExternalBuffer").IsBoolean()) { - enable_external_buffer = obj.Get("enableExternalBuffer").As().Value(); - } + bool enable_external_buffer = true; + if (obj.Has("enableExternalBuffer") && + obj.Get("enableExternalBuffer").IsBoolean()) { + enable_external_buffer = + obj.Get("enableExternalBuffer").As().Value(); + } - Napi::String _text = obj.Get("text").As(); - std::string text = _text.Utf8Value(); - int32_t sid = obj.Get("sid").As().Int32Value(); - float speed = obj.Get("speed").As().FloatValue(); - - Napi::Function cb; - if (obj.Has("callback") && obj.Get("callback").IsFunction()) { - cb = obj.Get("callback").As(); - } - - auto context = new Napi::Reference(Napi::Persistent(info.This())); - - TSFN tsfn = TSFN::New( + Napi::String _text = obj.Get("text").As(); + std::string text = _text.Utf8Value(); + int32_t sid = obj.Get("sid").As().Int32Value(); + float speed = obj.Get("speed").As().FloatValue(); + + Napi::Function cb; + if (obj.Has("callback") && obj.Get("callback").IsFunction()) { + cb = obj.Get("callback").As(); + } + + auto context = + new Napi::Reference(Napi::Persistent(info.This())); + + TSFN tsfn = TSFN::New( env, - cb, // JavaScript function called asynchronously - "TtsGenerateFunc", // Name - 0, // Unlimited queue - 1, // Only one thread will use this initially + cb, // JavaScript function called asynchronously + "TtsGenerateFunc", // Name + 0, // Unlimited queue + 1, // Only one thread will use this initially context, - [](Napi::Env, - void*, - Napi::Reference* ctx) { - delete ctx; - }); + [](Napi::Env, void *, Napi::Reference *ctx) { delete ctx; }); - const SherpaOnnxGeneratedAudio *audio; - TtsGenerateWorker *worker = new TtsGenerateWorker(env, tsfn, tts, text, speed, sid, enable_external_buffer); - worker->Queue(); - return worker->Promise(); + const SherpaOnnxGeneratedAudio *audio; + TtsGenerateWorker *worker = new TtsGenerateWorker( + env, tsfn, tts, text, speed, sid, enable_external_buffer); + worker->Queue(); + return worker->Promise(); } void InitNonStreamingTts(Napi::Env env, Napi::Object exports) { - exports.Set(Napi::String::New(env, "createOfflineTts"), Napi::Function::New(env, CreateOfflineTtsWrapper)); + exports.Set(Napi::String::New(env, "createOfflineTts"), + Napi::Function::New(env, CreateOfflineTtsWrapper)); - exports.Set(Napi::String::New(env, "getOfflineTtsSampleRate"), - Napi::Function::New(env, OfflineTtsSampleRateWrapper)); + exports.Set(Napi::String::New(env, "getOfflineTtsSampleRate"), + Napi::Function::New(env, OfflineTtsSampleRateWrapper)); - exports.Set(Napi::String::New(env, "getOfflineTtsNumSpeakers"), - Napi::Function::New(env, OfflineTtsNumSpeakersWrapper)); + exports.Set(Napi::String::New(env, "getOfflineTtsNumSpeakers"), + Napi::Function::New(env, OfflineTtsNumSpeakersWrapper)); - exports.Set(Napi::String::New(env, "offlineTtsGenerate"), Napi::Function::New(env, OfflineTtsGenerateWrapper)); + exports.Set(Napi::String::New(env, "offlineTtsGenerate"), + Napi::Function::New(env, OfflineTtsGenerateWrapper)); - exports.Set(Napi::String::New(env, "offlineTtsGenerateAsync"), - Napi::Function::New(env, OfflineTtsGenerateAsyncWrapper)); + exports.Set(Napi::String::New(env, "offlineTtsGenerateAsync"), + Napi::Function::New(env, OfflineTtsGenerateAsyncWrapper)); } diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc index 79e2442b8..33b8f2a29 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/utils.cc @@ -5,7 +5,7 @@ #include #include -#include "macros.h" +#include "macros.h" // NOLINT #include "napi.h" // NOLINT static std::vector GetFilenames(NativeResourceManager *mgr, diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 index 341f3c301..debb8e01e 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package-lock.json5 @@ -5,21 +5,22 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", - "sherpa_onnx@sherpa_onnx_4.har": "sherpa_onnx@sherpa_onnx_4.har" + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@1.10.32/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@1.10.32/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "sherpa_onnx@1.10.32": "sherpa_onnx@1.10.32" }, "packages": { - "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": { + "libsherpa_onnx.so@../oh_modules/.ohpm/sherpa_onnx@1.10.32/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx": { "name": "libsherpa_onnx.so", "version": "1.0.0", - "resolved": "../oh_modules/.ohpm/sherpa_onnx@9fqbo+h9xnw3+ap2rkq3c0gqtcfd72e82veswtld+d4=/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", + "resolved": "../oh_modules/.ohpm/sherpa_onnx@1.10.32/oh_modules/sherpa_onnx/src/main/cpp/types/libsherpa_onnx", "registryType": "local" }, - "sherpa_onnx@sherpa_onnx_4.har": { + "sherpa_onnx@1.10.32": { "name": "sherpa_onnx", "version": "1.10.32", - "resolved": "sherpa_onnx_4.har", - "registryType": "local", + "integrity": "sha512-yHYmWoeqhrunOqGr9gxPJJH/8+rdwcKFOW6onYByVObQVpbqypslg301IjGm9xpnc5bJEkO3S9sra2zQTpPA/w==", + "resolved": "https://ohpm.openharmony.cn/ohpm/sherpa_onnx/-/sherpa_onnx-1.10.32.har", + "registryType": "ohpm", "dependencies": { "libsherpa_onnx.so": "file:./src/main/cpp/types/libsherpa_onnx" } diff --git a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 index be784ea24..daff21b30 100644 --- a/harmony-os/SherpaOnnxTts/entry/oh-package.json5 +++ b/harmony-os/SherpaOnnxTts/entry/oh-package.json5 @@ -6,8 +6,7 @@ "author": "", "license": "", "dependencies": { - // "sherpa_onnx": "1.10.32", - "sherpa_onnx": "file:./sherpa_onnx_9.har" + "sherpa_onnx": "1.10.32", } } diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets index 0068730b9..45927b772 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxTts/entry/src/main/ets/pages/Index.ets @@ -50,6 +50,7 @@ function toInt16Samples(samples: Float32Array): Int16Array { @Entry @Component struct Index { + @State currentIndex: number = 0; @State title: string = 'Next-gen Kaldi: Text-to-speech'; @State info: string = ''; @State btnStartCaption: string = 'Start'; @@ -61,12 +62,13 @@ struct Index { @State progress: number = 0; @State sid: string = '0'; @State speechSpeed: string = '1.0'; - private cancelled: boolean = false; @State isGenerating: boolean = false; @State initTtsDone: boolean = false; @State ttsGeneratedDone: boolean = true; @State numSpeakers: number = 1; @State initAudioDone: boolean = false; + private controller: TabsController = new TabsController(); + private cancelled: boolean = false; private sampleRate: number = 0; private startTime: number = 0; private stopTime: number = 0; @@ -188,10 +190,8 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.ttsGeneratedDone = true; - console.log(`buffer size ${this.sampleBuffer.size()}`); - - if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING && this.sampleBuffer.size()==0) { - console.log(`here buffer size ${this.sampleBuffer.size()}`); + if (this.audioRenderer && this.audioRenderer?.state != audio.AudioState.STATE_RUNNING && + this.sampleBuffer.size() == 0) { this.sampleBuffer.push(samples); this.progress = 1; this.audioRenderer.start(); @@ -209,148 +209,179 @@ RTF = ${elapsedSeconds.toFixed(2)}/${audioDuration.toFixed(2)} = ${RTF.toFixed(3 this.workerInstance.postMessage({ msgType: 'init-tts', context: getContext() }); } + @Builder + TabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) { + Column() { + Image(this.currentIndex == targetIndex ? selectedImg : normalImg).size({ width: 25, height: 25 }) + Text(title).fontColor(this.currentIndex == targetIndex ? '#28bff1' : '#8a8a8a') + }.width('100%').height(50).justifyContent(FlexAlign.Center).onClick(() => { + this.currentIndex = targetIndex; + this.controller.changeIndex(this.currentIndex); + }) + } + build() { - Row() { - Column({ space: 10 }) { - Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); - if (this.numSpeakers > 1) { - Row({ space: 10 }) { - Text(`Speaker ID (0-${this.numSpeakers-1})`) - .width('60%') - - TextInput({ text: this.sid }) - .onChange((text) => { - this.sid = text.trim(); + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column({ space: 10 }) { + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); + if (this.numSpeakers > 1) { + Row({ space: 10 }) { + Text(`Speaker ID (0-${this.numSpeakers - 1})`).width('60%') + + TextInput({ text: this.sid }).onChange((text) => { + this.sid = text.trim(); + }).width('20%') + }.justifyContent(FlexAlign.Center) + } + + Row() { + Text('Speech speed').width('60%'); + + TextInput({ text: this.speechSpeed }).onChange((text) => { + this.speechSpeed = text.trim(); + }).width('20%') + } + + Row({ space: 10 }) { + Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { + let sid = parseInt(this.sid); + if (sid.toString() != this.sid) { + this.info = 'Please input a valid speaker ID'; + return; + } + + let speed = parseFloat(this.speechSpeed); + if (isNaN(speed)) { + this.info = 'Please enter a valid speech speed'; + return; + } + + if (speed <= 0) { + this.info = 'Please enter a positive speech speed'; + return; + } + + if (this.workerInstance && this.initTtsDone) { + this.info = 'Generating...'; + this.cancelled = false; + this.finalSamples = null; + this.sampleBuffer.reset(); + this.ttsGeneratedDone = false; + this.progress = 0; + + this.btnStartEnabled = false; + this.btnStopEnabled = true; + this.btnSaveEnabled = false; + console.log(`sending ${this.inputText}`) + this.ttsGeneratedDone = false; + this.startTime = await systemTime.getRealTime(); + this.workerInstance?.postMessage({ + msgType: 'tts-generate', + text: this.inputText, + sid: sid, + speed: speed, + }); + this.isGenerating = true; + this.info = ''; + } else { + this.info = 'Failed to initialize tts model'; + this.btnStartEnabled = false; + } + }); + + Button(this.btnStopCaption).enabled(this.btnStopEnabled).onClick(() => { + this.ttsGeneratedDone = true; + this.btnStartEnabled = true; + this.btnStopEnabled = false; + this.sampleBuffer.reset(); + this.cancelled = true; + this.isGenerating = false; + + if (this.workerInstance && this.initTtsDone) { + this.workerInstance.postMessage({ msgType: 'tts-generate-cancel' }); + } + this.audioRenderer?.stop(); }) - .width('20%') - }.justifyContent(FlexAlign.Center) - } - Row() { - Text('Speech speed') - .width('60%'); + Button(this.btnSaveCaption).enabled(this.btnSaveEnabled).onClick(() => { + if (!this.finalSamples || this.finalSamples.length == 0) { - TextInput({ text: this.speechSpeed }) - .onChange((text) => { - this.speechSpeed = text.trim(); - }) - .width('20%') - } + this.btnSaveEnabled = false; + return; + } - Row({ space: 10 }) { - Button(this.btnStartCaption).enabled(this.btnStartEnabled).onClick(async () => { - let sid = parseInt(this.sid); - if (sid.toString() != this.sid) { - this.info = 'Please input a valid speaker ID'; - return; - } + let uri: string = ''; - let speed = parseFloat(this.speechSpeed); - if (isNaN(speed)) { - this.info = 'Please enter a valid speech speed'; - return; - } + const audioOptions = new picker.AudioSaveOptions(); // audioOptions.newFileNames = ['o.wav']; - if (speed <= 0) { - this.info = 'Please enter a positive speech speed'; - return; - } + const audioViewPicker = new picker.AudioViewPicker(); - if (this.workerInstance && this.initTtsDone) { - this.info = 'Generating...'; - this.cancelled = false; - this.finalSamples = null; - this.sampleBuffer.reset(); - this.ttsGeneratedDone = false; - this.progress = 0; - - this.btnStartEnabled = false; - this.btnStopEnabled = true; - this.btnSaveEnabled = false; - console.log(`sending ${this.inputText}`) - this.ttsGeneratedDone = false; - this.startTime = await systemTime.getRealTime(); - this.workerInstance?.postMessage({ - msgType: 'tts-generate', - text: this.inputText, - sid: sid, - speed: speed, + audioViewPicker.save(audioOptions).then((audioSelectResult: Array) => { + uri = audioSelectResult[0]; + if (this.finalSamples) { + savePcmToWav(uri, toInt16Samples(this.finalSamples), this.sampleRate); + console.log(`Saved to ${uri}`); + this.info += `\nSaved to ${uri}`; + } + }); }); - this.isGenerating = true; - this.info = ''; - } else { - this.info = 'Failed to initialize tts model'; - this.btnStartEnabled = false; - } - }); - - Button(this.btnStopCaption).enabled(this.btnStopEnabled).onClick(() => { - this.ttsGeneratedDone = true; - this.btnStartEnabled = true; - this.btnStopEnabled = false; - this.sampleBuffer.reset(); - this.cancelled = true; - this.isGenerating = false; - - if (this.workerInstance && this.initTtsDone) { - this.workerInstance.postMessage({ msgType: 'tts-generate-cancel'}); } - this.audioRenderer?.stop(); - }) - Button(this.btnSaveCaption).enabled(this.btnSaveEnabled).onClick(() => { - if (!this.finalSamples || this.finalSamples.length == 0) { - - this.btnSaveEnabled = false; - return; + if (this.info != '') { + TextArea({ text: this.info }).focusable(false); + } + if (this.progress > 0) { + Row() { + Progress({ value: 0, total: 100, type: ProgressType.Capsule }) + .width('80%') + .height(20) + .value(this.progress * 100); + + Text(`${(this.progress * 100).toFixed(2)}%`).width('15%') + }.width('100%').justifyContent(FlexAlign.Center) } - let uri: string = ''; + TextArea({ placeholder: 'Input text for TTS and click the start button' }) + .width('100%') + .height('100%') + .focusable(this.isGenerating == false && this.initTtsDone) + .onChange((text) => { + this.inputText = text; + if (text.trim() == '') { + this.btnStartEnabled = false; + return; + } + this.btnStartEnabled = true; + }) + }.width('100%') + + // see https://composeicons.com/ + }.tabBar(this.TabBuilder('TTS', 0, $r('app.media.home'), $r('app.media.home'))) - const audioOptions = new picker.AudioSaveOptions(); // audioOptions.newFileNames = ['o.wav']; + TabContent() { + Column({space: 10}) { + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); + TextArea({text: ` +Everyting is open-sourced. - const audioViewPicker = new picker.AudioViewPicker(); +It runs locally, without accessing the network - audioViewPicker.save(audioOptions).then((audioSelectResult: Array) => { - uri = audioSelectResult[0]; - if (this.finalSamples) { - savePcmToWav(uri, toInt16Samples(this.finalSamples), this.sampleRate); - console.log(`Saved to ${uri}}`); - this.info += `\nSaved to ${uri}`; - } - }); +See also https://github.com/k2-fsa/sherpa-onnx - }) - } +新一代 Kaldi QQ 和微信交流群: 请看 - if (this.info != '') { - TextArea({ text: this.info }).focusable(false); - } - if (this.progress > 0) { - Row() { - Progress({ value: 0, total: 100, type: ProgressType.Capsule }) - .width('80%') - .height(20) - .value(this.progress * 100); - - Text(`${(this.progress * 100).toFixed(2)}%`).width('15%') - }.width('100%').justifyContent(FlexAlign.Center) - } +https://k2-fsa.github.io/sherpa/social-groups.html - TextArea({ placeholder: 'Input text for TTS and click the start button' }) - .width('100%') - .height('100%') - .focusable(this.isGenerating == false && this.initTtsDone) - .onChange((text) => { - this.inputText = text; - if (text.trim() == '') { - this.btnStartEnabled = false; - return; - } - this.btnStartEnabled = true; - }) - }.width('100%') - }.height('100%') +微信公众号: 新一代 Kaldi + `}).width('100%') + .height('100%') + .focusable(false) + }.justifyContent(FlexAlign.Start) + }.tabBar(this.TabBuilder('Help', 1, $r('app.media.info'), $r('app.media.info'))) + }.scrollable(false) + } } private audioPlayCallback = (buffer: ArrayBuffer) => { diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json index c7648b51e..29b5d21cd 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/element/string.json @@ -2,11 +2,11 @@ "string": [ { "name": "module_desc", - "value": "module description" + "value": "On-device text-to-speech with Next-gen Kaldi" }, { "name": "EntryAbility_desc", - "value": "description" + "value": "On-device text-to-speech with Next-gen Kaldi" }, { "name": "EntryAbility_label", diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/home.svg b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/home.svg new file mode 100644 index 000000000..504af3400 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/info.svg b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/info.svg new file mode 100644 index 000000000..2210223f4 --- /dev/null +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/base/media/info.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json index f94595515..29b5d21cd 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/en_US/element/string.json @@ -2,15 +2,15 @@ "string": [ { "name": "module_desc", - "value": "module description" + "value": "On-device text-to-speech with Next-gen Kaldi" }, { "name": "EntryAbility_desc", - "value": "description" + "value": "On-device text-to-speech with Next-gen Kaldi" }, { "name": "EntryAbility_label", - "value": "label" + "value": "TTS" } ] } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json b/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json index 597ecf95e..c545b1b46 100644 --- a/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json +++ b/harmony-os/SherpaOnnxTts/entry/src/main/resources/zh_CN/element/string.json @@ -2,15 +2,15 @@ "string": [ { "name": "module_desc", - "value": "模块描述" + "value": "使用新一代Kaldi进行本地离线语音合成" }, { "name": "EntryAbility_desc", - "value": "description" + "value": "使用新一代Kaldi进行本地离线语音合成" }, { "name": "EntryAbility_label", - "value": "label" + "value": "本地语音合成" } ] } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxVadAsr/entry/src/main/ets/pages/Index.ets b/harmony-os/SherpaOnnxVadAsr/entry/src/main/ets/pages/Index.ets index b0695f3a0..2675c7b77 100644 --- a/harmony-os/SherpaOnnxVadAsr/entry/src/main/ets/pages/Index.ets +++ b/harmony-os/SherpaOnnxVadAsr/entry/src/main/ets/pages/Index.ets @@ -11,6 +11,7 @@ import { audio } from '@kit.AudioKit'; @Entry @Component struct Index { + @State title: string = 'Next-gen Kaldi: VAD + ASR'; @State currentIndex: number = 0; @State resultForFile: string = ''; @State progressForFile: number = 0; @@ -73,13 +74,11 @@ struct Index { }; const audioCapturerInfo: audio.AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 + source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 }; const audioCapturerOptions: audio.AudioCapturerOptions = { - streamInfo: audioStreamInfo, - capturerInfo: audioCapturerInfo + streamInfo: audioStreamInfo, capturerInfo: audioCapturerInfo }; audio.createAudioCapturer(audioCapturerOptions, (err, data) => { @@ -162,15 +161,9 @@ struct Index { @Builder TabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) { Column() { - Image(this.currentIndex == targetIndex ? selectedImg : normalImg) - .size({ width: 25, height: 25 }) - Text(title) - .fontColor(this.currentIndex == targetIndex ? '#28bff1' : '#8a8a8a') - } - .width('100%') - .height(50) - .justifyContent(FlexAlign.Center) - .onClick(() => { + Image(this.currentIndex == targetIndex ? selectedImg : normalImg).size({ width: 25, height: 25 }) + Text(title).fontColor(this.currentIndex == targetIndex ? '#28bff1' : '#8a8a8a') + }.width('100%').height(50).justifyContent(FlexAlign.Center).onClick(() => { this.currentIndex = targetIndex; this.controller.changeIndex(this.currentIndex); }) @@ -181,11 +174,7 @@ struct Index { Tabs({ barPosition: BarPosition.End, controller: this.controller }) { TabContent() { Column({ space: 10 }) { - Text('Next-gen Kaldi: VAD + ASR') - .fontColor('#182431') - .fontSize(25) - .lineHeight(41) - .fontWeight(500) + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); Button('Select .wav file (16kHz) ') .enabled(this.selectFileBtnEnabled) @@ -211,8 +200,7 @@ struct Index { if (this.workerInstance) { this.workerInstance.postMessage({ - msgType: 'non-streaming-asr-vad-decode', - filename: result[0], + msgType: 'non-streaming-asr-vad-decode', filename: result[0], }); } else { console.log(`this worker instance is undefined ${this.workerInstance}`); @@ -236,80 +224,86 @@ struct Index { }.width('100%').justifyContent(FlexAlign.Center) } - TextArea({ text: this.resultForFile }).width('100%').lineSpacing({ value: 10, unit: LengthUnit.VP }); - - } - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Start) + TextArea({ text: this.resultForFile }) + .width('100%') + .lineSpacing({ value: 10, unit: LengthUnit.VP }) + .height('100%'); + }.alignItems(HorizontalAlign.Center).justifyContent(FlexAlign.Start) }.tabBar(this.TabBuilder('From file', 0, $r('app.media.icon_doc'), $r('app.media.icon_doc_default'))) TabContent() { - Column() { - Button(this.message) - .enabled(this.micInitDone) - .onClick(() => { - console.log('clicked mic button'); - this.resultForMic = ''; - if (this.mic) { - if (this.micStarted) { - this.mic.stop(); - this.message = "Start recording"; - this.micStarted = false; - console.log('mic stopped'); - - const samples = this.flatten(this.sampleList); - let s = 0; - for (let i = 0; i < samples.length; ++i) { - s += samples[i]; - } - console.log(`samples ${samples.length}, sum: ${s}`); - - if (this.workerInstance) { - console.log('decode mic'); - this.workerInstance.postMessage({ - msgType: 'non-streaming-asr-vad-mic', - samples, - }); - } else { - console.log(`this worker instance is undefined ${this.workerInstance}`); - } + Column({ space: 10 }) { + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); + Button(this.message).enabled(this.micInitDone).onClick(() => { + console.log('clicked mic button'); + this.resultForMic = ''; + if (this.mic) { + if (this.micStarted) { + this.mic.stop(); + this.message = "Start recording"; + this.micStarted = false; + console.log('mic stopped'); + + const samples = this.flatten(this.sampleList); + let s = 0; + for (let i = 0; i < samples.length; ++i) { + s += samples[i]; + } + console.log(`samples ${samples.length}, sum: ${s}`); + + if (this.workerInstance) { + console.log('decode mic'); + this.workerInstance.postMessage({ + msgType: 'non-streaming-asr-vad-mic', samples, + }); } else { - this.sampleList = []; - this.mic.start(); - this.message = "Stop recording"; - this.micStarted = true; - console.log('mic started'); + console.log(`this worker instance is undefined ${this.workerInstance}`); } + } else { + this.sampleList = []; + this.mic.start(); + this.message = "Stop recording"; + this.micStarted = true; + console.log('mic started'); } - }); + } + }); Text(`Supported languages: ${this.lang}`) - TextArea({ text: this.resultForMic }).width('100%').lineSpacing({ value: 10, unit: LengthUnit.VP }); - } - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Start) + TextArea({ text: this.resultForMic }) + .width('100%') + .lineSpacing({ value: 10, unit: LengthUnit.VP }) + .width('100%') + .height('100%'); + }.alignItems(HorizontalAlign.Center).justifyContent(FlexAlign.Start) } .tabBar(this.TabBuilder('From mic', 1, $r('app.media.ic_public_input_voice'), $r('app.media.ic_public_input_voice_default'))) TabContent() { - Column() { - Text("Everything is open-sourced"); - Divider(); - Text("It runs locally, without accessing the network"); - Divider(); - Text("See also https://github.com/k2-fsa/sherpa-onnx"); - Divider(); - Text("and https://k2-fsa.github.io/sherpa/social-groups.html"); + Column({ space: 10 }) { + Text(this.title).fontSize(20).fontWeight(FontWeight.Bold); + TextArea({ + text: ` +Everyting is open-sourced. + +It runs locally, without accessing the network + +See also https://github.com/k2-fsa/sherpa-onnx + +新一代 Kaldi QQ 和微信交流群: 请看 + +https://k2-fsa.github.io/sherpa/social-groups.html + +微信公众号: 新一代 Kaldi + ` + }).width('100%').height('100%').focusable(false) }.justifyContent(FlexAlign.Start) - }.tabBar(this.TabBuilder('Help', 2, $r('app.media.info_circle'), - $r('app.media.info_circle_default'))) + }.tabBar(this.TabBuilder('Help', 2, $r('app.media.info_circle'), $r('app.media.info_circle_default'))) }.scrollable(false) - } - .width('100%') - .justifyContent(FlexAlign.Start) + }.width('100%').justifyContent(FlexAlign.Start) } private micCallback = (buffer: ArrayBuffer) => { diff --git a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/base/element/string.json b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/base/element/string.json index 09e201b54..652fac4cc 100644 --- a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/base/element/string.json +++ b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/base/element/string.json @@ -2,19 +2,19 @@ "string": [ { "name": "module_desc", - "value": "VAD+ASR with Next-gen Kaldi" + "value": "On-device VAD+ASR with Next-gen Kaldi" }, { "name": "EntryAbility_desc", - "value": "VAD+ASR" + "value": "On-device VAD+ASR with Next-gen Kaldi" }, { "name": "EntryAbility_label", - "value": "VAD_ASR" + "value": "On-device speech recognition" }, { "name": "mic_reason", - "value": "access the microhone for speech recognition" + "value": "access the microhone for on-device speech recognition with Next-gen Kaldi" } ] } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/en_US/element/string.json b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/en_US/element/string.json index f94595515..652fac4cc 100644 --- a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/en_US/element/string.json +++ b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/en_US/element/string.json @@ -2,15 +2,19 @@ "string": [ { "name": "module_desc", - "value": "module description" + "value": "On-device VAD+ASR with Next-gen Kaldi" }, { "name": "EntryAbility_desc", - "value": "description" + "value": "On-device VAD+ASR with Next-gen Kaldi" }, { "name": "EntryAbility_label", - "value": "label" + "value": "On-device speech recognition" + }, + { + "name": "mic_reason", + "value": "access the microhone for on-device speech recognition with Next-gen Kaldi" } ] } \ No newline at end of file diff --git a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/zh_CN/element/string.json b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/zh_CN/element/string.json index 597ecf95e..00384ae7f 100644 --- a/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/zh_CN/element/string.json +++ b/harmony-os/SherpaOnnxVadAsr/entry/src/main/resources/zh_CN/element/string.json @@ -2,15 +2,19 @@ "string": [ { "name": "module_desc", - "value": "模块描述" + "value": "基于新一代Kaldi的本地语音识别" }, { "name": "EntryAbility_desc", - "value": "description" + "value": "基于新一代Kaldi的本地语音识别" }, { "name": "EntryAbility_label", - "value": "label" + "value": "本地语音识别" + }, + { + "name": "mic_reason", + "value": "使用新一代Kaldi, 访问麦克风进行本地语音识别 (不需要联网)" } ] } \ No newline at end of file