顾真牛
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
@@ -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;