OfflineTtsVitsModelConfig.java
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright 2024 Xiaomi Corporation
package com.k2fsa.sherpa.onnx;
public class OfflineTtsVitsModelConfig {
private final String model;
private final String lexicon;
private final String tokens;
private final String dataDir;
private final String dictDir;
private final float noiseScale;
private final float noiseScaleW;
private final float lengthScale;
private OfflineTtsVitsModelConfig(Builder builder) {
this.model = builder.model;
this.lexicon = builder.lexicon;
this.tokens = builder.tokens;
this.dataDir = builder.dataDir;
this.dictDir = builder.dictDir;
this.noiseScale = builder.noiseScale;
this.noiseScaleW = builder.noiseScaleW;
this.lengthScale = builder.lengthScale;
}
public static Builder builder() {
return new Builder();
}
public String getModel() {
return model;
}
public String getLexicon() {
return lexicon;
}
public String getTokens() {
return tokens;
}
public String getDataDir() {
return dataDir;
}
public String getDictDir() {
return dictDir;
}
public float getLengthScale() {
return lengthScale;
}
public float getNoiseScale() {
return noiseScale;
}
public float getNoiseScaleW() {
return noiseScaleW;
}
public static class Builder {
private String model = "";
private String lexicon = "";
private String tokens = "";
private String dataDir = "";
private String dictDir = "";
private float noiseScale = 0.667f;
private float noiseScaleW = 0.8f;
private float lengthScale = 1.0f;
public OfflineTtsVitsModelConfig build() {
return new OfflineTtsVitsModelConfig(this);
}
public Builder setModel(String model) {
this.model = model;
return this;
}
public Builder setTokens(String tokens) {
this.tokens = tokens;
return this;
}
public Builder setLexicon(String lexicon) {
this.lexicon = lexicon;
return this;
}
public Builder setDataDir(String dataDir) {
this.dataDir = dataDir;
return this;
}
public Builder setDictDir(String dictDir) {
this.dictDir = dictDir;
return this;
}
public Builder setNoiseScale(float noiseScale) {
this.noiseScale = noiseScale;
return this;
}
public Builder setNoiseScaleW(float noiseScaleW) {
this.noiseScaleW = noiseScaleW;
return this;
}
public Builder setLengthScale(float lengthScale) {
this.lengthScale = lengthScale;
return this;
}
}
}