OfflineTtsKokoroModelConfig.java
1.9 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
// Copyright 2025 Xiaomi Corporation
package com.k2fsa.sherpa.onnx;
public class OfflineTtsKokoroModelConfig {
private final String model;
private final String voices;
private final String tokens;
private final String dataDir;
private final float lengthScale;
private OfflineTtsKokoroModelConfig(Builder builder) {
this.model = builder.model;
this.voices = builder.voices;
this.tokens = builder.tokens;
this.dataDir = builder.dataDir;
this.lengthScale = builder.lengthScale;
}
public static Builder builder() {
return new Builder();
}
public String getModel() {
return model;
}
public String getVoices() {
return voices;
}
public String getTokens() {
return tokens;
}
public String getDataDir() {
return dataDir;
}
public float getLengthScale() {
return lengthScale;
}
public static class Builder {
private String model = "";
private String voices = "";
private String tokens = "";
private String dataDir = "";
private float lengthScale = 1.0f;
public OfflineTtsKokoroModelConfig build() {
return new OfflineTtsKokoroModelConfig(this);
}
public Builder setModel(String model) {
this.model = model;
return this;
}
public Builder setVoices(String voices) {
this.voices = voices;
return this;
}
public Builder setTokens(String tokens) {
this.tokens = tokens;
return this;
}
public Builder setDataDir(String dataDir) {
this.dataDir = dataDir;
return this;
}
public Builder setLengthScale(float lengthScale) {
this.lengthScale = lengthScale;
return this;
}
}
}