csukuangfj commited on
Commit
71e2c21
·
1 Parent(s): bfeb007

update model

Browse files
sherpa-onnx-tts.js CHANGED
@@ -543,17 +543,17 @@ class OfflineTts {
543
  }
544
 
545
  function createOfflineTts(Module, myConfig) {
546
- const offlineTtsVitsModelConfig = {
547
- model: './model.onnx',
548
  lexicon: '',
549
- tokens: './tokens.txt',
550
- dataDir: './espeak-ng-data',
551
  noiseScale: 0.667,
552
  noiseScaleW: 0.8,
553
  lengthScale: 1.0,
554
  };
555
 
556
- const offlineTtsMatchaModelConfig = {
557
  acousticModel: '',
558
  vocoder: '',
559
  lexicon: '',
@@ -581,9 +581,40 @@ function createOfflineTts(Module, myConfig) {
581
  lengthScale: 1.0,
582
  };
583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
  const offlineTtsModelConfig = {
585
- offlineTtsVitsModelConfig: offlineTtsVitsModelConfig,
586
- offlineTtsMatchaModelConfig: offlineTtsMatchaModelConfig,
587
  offlineTtsKokoroModelConfig: offlineTtsKokoroModelConfig,
588
  offlineTtsKittenModelConfig: offlineTtsKittenModelConfig,
589
  numThreads: 1,
@@ -593,7 +624,7 @@ function createOfflineTts(Module, myConfig) {
593
 
594
  let offlineTtsConfig = {
595
  offlineTtsModelConfig: offlineTtsModelConfig,
596
- ruleFsts: '',
597
  ruleFars: '',
598
  maxNumSentences: 1,
599
  }
 
543
  }
544
 
545
  function createOfflineTts(Module, myConfig) {
546
+ const vits = {
547
+ model: '',
548
  lexicon: '',
549
+ tokens: '',
550
+ dataDir: '',
551
  noiseScale: 0.667,
552
  noiseScaleW: 0.8,
553
  lengthScale: 1.0,
554
  };
555
 
556
+ const matcha = {
557
  acousticModel: '',
558
  vocoder: '',
559
  lexicon: '',
 
581
  lengthScale: 1.0,
582
  };
583
 
584
+ let ruleFsts = '';
585
+
586
+ let type = 0;
587
+ switch (type) {
588
+ case 0:
589
+ // vits
590
+ vits.model = './model.onnx';
591
+ vits.tokens = './tokens.txt';
592
+ vits.dataDir = './espeak-ng-data';
593
+ break;
594
+ case 1:
595
+ // matcha zh-en
596
+ // https://k2-fsa.github.io/sherpa/onnx/tts/all/Chinese-English/matcha-icefall-zh-en.html
597
+ matcha.acousticModel = './model-steps-3.onnx';
598
+ matcha.vocoder = './vocos-16khz-univ.onnx';
599
+ matcha.lexicon = './lexicon.txt';
600
+ matcha.tokens = './tokens.txt';
601
+ matcha.dataDir = './espeak-ng-data';
602
+ ruleFsts = './phone-zh.fst,./date-zh.fst,./number-zh.fst';
603
+ break;
604
+ case 2:
605
+ // matcha zh
606
+ // https://k2-fsa.github.io/sherpa/onnx/tts/all/Chinese/matcha-icefall-zh-baker.html
607
+ matcha.acousticModel = './model-steps-3.onnx';
608
+ matcha.vocoder = './vocos-22khz-univ.onnx';
609
+ matcha.lexicon = './lexicon.txt';
610
+ matcha.tokens = './tokens.txt';
611
+ ruleFsts = './phone.fst,./date.fst,./number.fst';
612
+ break;
613
+ }
614
+
615
  const offlineTtsModelConfig = {
616
+ offlineTtsVitsModelConfig: vits,
617
+ offlineTtsMatchaModelConfig: matcha,
618
  offlineTtsKokoroModelConfig: offlineTtsKokoroModelConfig,
619
  offlineTtsKittenModelConfig: offlineTtsKittenModelConfig,
620
  numThreads: 1,
 
624
 
625
  let offlineTtsConfig = {
626
  offlineTtsModelConfig: offlineTtsModelConfig,
627
+ ruleFsts: ruleFsts,
628
  ruleFars: '',
629
  maxNumSentences: 1,
630
  }
sherpa-onnx-wasm-main-tts.data CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5386f0caf2a89aeae7c7cc379b7b0abf830a029e9ca23b6185c90da69d59fd21
3
  size 96523617
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7ce2d43070f87274774b8426e5ca7440a4fed2b1ecd8fe6dccb792f42a2016e
3
  size 96523617
sherpa-onnx-wasm-main-tts.js CHANGED
The diff for this file is too large to render. See raw diff