We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18cf458 commit c3d5c59Copy full SHA for c3d5c59
src/lib/shared/kokoro/kokoro.ts
@@ -79,6 +79,11 @@ export async function generateVoice(params: {
79
}
80
81
if (chunk.type === "text") {
82
+ if (chunk.tokens?.length ?? 0 < 1) {
83
+ console.log("Skipping chunk with no tokens");
84
+ continue;
85
+ }
86
+
87
console.log({ type: chunk.type, content: chunk.content });
88
89
const tokens = chunk.tokens;
@@ -103,6 +108,10 @@ export async function generateVoice(params: {
103
108
104
109
105
110
111
+ if (waveforms.length === 0) {
112
+ throw new Error("No waveforms generated");
113
114
106
115
const finalWaveform = new Float32Array(waveformsLen);
107
116
let offset = 0;
117
for (const waveform of waveforms) {
0 commit comments