miraclemind commited on
Commit
7cc7616
·
1 Parent(s): 7aef60a

Add second set of female and male voices

Browse files
Files changed (3) hide show
  1. src/App.tsx +1 -1
  2. src/components/Controls.tsx +1 -1
  3. src/tts.ts +7 -3
src/App.tsx CHANGED
@@ -16,7 +16,7 @@ const AppContent = () => {
16
  const [showResults, setShowResults] = useState(false);
17
  const [quality, setQuality] = useState(5);
18
  const [speed, setSpeed] = useState(1.0);
19
- const [voice, setVoice] = useState("Female");
20
 
21
  const { pipelineReady, tts, speakerEmbeddings, downloadProgress } = useTTS();
22
 
 
16
  const [showResults, setShowResults] = useState(false);
17
  const [quality, setQuality] = useState(5);
18
  const [speed, setSpeed] = useState(1.0);
19
+ const [voice, setVoice] = useState("Female1");
20
 
21
  const { pipelineReady, tts, speakerEmbeddings, downloadProgress } = useTTS();
22
 
src/components/Controls.tsx CHANGED
@@ -36,7 +36,7 @@ export const Controls = ({
36
  <div className="flex items-center gap-6">
37
  <span className="font-semibold text-gray-900">Voice:</span>
38
  <div className="flex gap-4 text-sm">
39
- {["Female", "Male"].map((v) => (
40
  <button
41
  key={v}
42
  onClick={() => setVoice(v)}
 
36
  <div className="flex items-center gap-6">
37
  <span className="font-semibold text-gray-900">Voice:</span>
38
  <div className="flex gap-4 text-sm">
39
+ {["Female1", "Male1", "Female2", "Male2"].map((v) => (
40
  <button
41
  key={v}
42
  onClick={() => setVoice(v)}
src/tts.ts CHANGED
@@ -29,13 +29,17 @@ export async function loadPipeline(progressCallback: (info: any) => void) {
29
 
30
  export async function loadEmbeddings() {
31
  return (embeddingsPromise ??= (async () => {
32
- const [female, male] = await Promise.all([
33
  fetch(`${VOICES_URL}F1.bin`).then((r) => r.arrayBuffer()),
34
  fetch(`${VOICES_URL}M1.bin`).then((r) => r.arrayBuffer()),
 
 
35
  ]);
36
  return {
37
- Female: new Float32Array(female),
38
- Male: new Float32Array(male),
 
 
39
  };
40
  })());
41
  }
 
29
 
30
  export async function loadEmbeddings() {
31
  return (embeddingsPromise ??= (async () => {
32
+ const [female1, male1, female2, male2] = await Promise.all([
33
  fetch(`${VOICES_URL}F1.bin`).then((r) => r.arrayBuffer()),
34
  fetch(`${VOICES_URL}M1.bin`).then((r) => r.arrayBuffer()),
35
+ fetch(`${VOICES_URL}F2.bin`).then((r) => r.arrayBuffer()),
36
+ fetch(`${VOICES_URL}M2.bin`).then((r) => r.arrayBuffer()),
37
  ]);
38
  return {
39
+ Female1: new Float32Array(female1),
40
+ Male1: new Float32Array(male1),
41
+ Female2: new Float32Array(female2),
42
+ Male2: new Float32Array(male2),
43
  };
44
  })());
45
  }