Commit
·
7536df1
1
Parent(s):
71b5b68
update model
Browse files- sherpa-onnx-tts.js +6 -2
- sherpa-onnx-wasm-main-tts.js +0 -0
sherpa-onnx-tts.js
CHANGED
|
@@ -21,7 +21,7 @@ function freeConfig(config, Module) {
|
|
| 21 |
|
| 22 |
// The user should free the returned pointers
|
| 23 |
function initSherpaOnnxOfflineTtsVitsModelConfig(config, Module) {
|
| 24 |
-
const modelLen = Module.lengthBytesUTF8(config.model) + 1;
|
| 25 |
const lexiconLen = Module.lengthBytesUTF8(config.lexicon || '') + 1;
|
| 26 |
const tokensLen = Module.lengthBytesUTF8(config.tokens || '') + 1;
|
| 27 |
const dataDirLen = Module.lengthBytesUTF8(config.dataDir || '') + 1;
|
|
@@ -282,7 +282,7 @@ function initSherpaOnnxOfflineTtsModelConfig(config, Module) {
|
|
| 282 |
function initSherpaOnnxOfflineTtsConfig(config, Module) {
|
| 283 |
const modelConfig =
|
| 284 |
initSherpaOnnxOfflineTtsModelConfig(config.offlineTtsModelConfig, Module);
|
| 285 |
-
const len = modelConfig.len +
|
| 286 |
const ptr = Module._malloc(len);
|
| 287 |
|
| 288 |
let offset = 0;
|
|
@@ -303,6 +303,10 @@ function initSherpaOnnxOfflineTtsConfig(config, Module) {
|
|
| 303 |
offset += 4;
|
| 304 |
|
| 305 |
Module.setValue(ptr + offset, buffer + ruleFstsLen, 'i8*');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
|
| 307 |
return {
|
| 308 |
buffer: buffer, ptr: ptr, len: len, config: modelConfig,
|
|
|
|
| 21 |
|
| 22 |
// The user should free the returned pointers
|
| 23 |
function initSherpaOnnxOfflineTtsVitsModelConfig(config, Module) {
|
| 24 |
+
const modelLen = Module.lengthBytesUTF8(config.model || '') + 1;
|
| 25 |
const lexiconLen = Module.lengthBytesUTF8(config.lexicon || '') + 1;
|
| 26 |
const tokensLen = Module.lengthBytesUTF8(config.tokens || '') + 1;
|
| 27 |
const dataDirLen = Module.lengthBytesUTF8(config.dataDir || '') + 1;
|
|
|
|
| 282 |
function initSherpaOnnxOfflineTtsConfig(config, Module) {
|
| 283 |
const modelConfig =
|
| 284 |
initSherpaOnnxOfflineTtsModelConfig(config.offlineTtsModelConfig, Module);
|
| 285 |
+
const len = modelConfig.len + 4 * 4;
|
| 286 |
const ptr = Module._malloc(len);
|
| 287 |
|
| 288 |
let offset = 0;
|
|
|
|
| 303 |
offset += 4;
|
| 304 |
|
| 305 |
Module.setValue(ptr + offset, buffer + ruleFstsLen, 'i8*');
|
| 306 |
+
offset += 4;
|
| 307 |
+
|
| 308 |
+
Module.setValue(ptr + offset, config.silenceScale || 0.2, 'float');
|
| 309 |
+
offset += 4;
|
| 310 |
|
| 311 |
return {
|
| 312 |
buffer: buffer, ptr: ptr, len: len, config: modelConfig,
|
sherpa-onnx-wasm-main-tts.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|