File size: 1,232 Bytes
25647ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import React from 'react'
import { Label } from '@/components/ui/label'
import { Input } from '@/components/ui/input'
import { useTextToSpeech } from '../../contexts/TextToSpeechContext'

interface TextToSpeechConfigProps {
  className?: string
}

const TextToSpeechConfig: React.FC<TextToSpeechConfigProps> = ({
  className = ''
}) => {
  const { config, setConfig } = useTextToSpeech()

  return (
    <div className={`space-y-4 ${className}`}>
      <div className="space-y-2">
        <Label htmlFor="speakerEmbeddings" className="text-sm font-medium">
          Speaker Embeddings URL
        </Label>
        <Input
          id="speakerEmbeddings"
          type="url"
          value={config.speakerEmbeddings}
          onChange={(e) =>
            setConfig((prev) => ({
              ...prev,
              speakerEmbeddings: e.target.value
            }))
          }
          placeholder="https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/speaker_embeddings.bin"
          className="text-sm"
        />
        <p className="text-xs text-gray-500">
          URL to speaker embeddings file for voice characteristics
        </p>
      </div>
    </div>
  )
}

export default TextToSpeechConfig