Committed by
GitHub
Update sherpa-onnx-tts.js VitsModelConfig.model can be none (#1817)
* Update sherpa-onnx-tts.js VitsModelConfig.model can be none * Update sherpa-onnx-tts.js
正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -21,7 +21,7 @@ function freeConfig(config, Module) { | @@ -21,7 +21,7 @@ function freeConfig(config, Module) { | ||
| 21 | 21 | ||
| 22 | // The user should free the returned pointers | 22 | // The user should free the returned pointers |
| 23 | function initSherpaOnnxOfflineTtsVitsModelConfig(config, Module) { | 23 | function initSherpaOnnxOfflineTtsVitsModelConfig(config, Module) { |
| 24 | - const modelLen = Module.lengthBytesUTF8(config.model) + 1; | 24 | + const modelLen = Module.lengthBytesUTF8(config.model || '')+ 1; |
| 25 | const lexiconLen = Module.lengthBytesUTF8(config.lexicon || '') + 1; | 25 | const lexiconLen = Module.lengthBytesUTF8(config.lexicon || '') + 1; |
| 26 | const tokensLen = Module.lengthBytesUTF8(config.tokens || '') + 1; | 26 | const tokensLen = Module.lengthBytesUTF8(config.tokens || '') + 1; |
| 27 | const dataDirLen = Module.lengthBytesUTF8(config.dataDir || '') + 1; | 27 | const dataDirLen = Module.lengthBytesUTF8(config.dataDir || '') + 1; |
-
请 注册 或 登录 后发表评论