FantasyTalking इन्स्टॉलेशन मार्गदर्शक
आवश्यकता
FantasyTalking इन्स्टॉल करण्यापूर्वी, तुमचे विकास वातावरण खालील आवश्यकता पूर्ण करते याची खात्री करा. ऑपरेटिंग सिस्टम्ससाठी, प्रोजेक्ट Windows, macOS आणि Linux ला समर्थन देते. इष्टतम कार्यक्षमतेसाठी 64-बिट सिस्टम वापरण्याची शिफारस केली जाते. Node.js आवृत्ती 14.0 किंवा त्याहून अधिक आवश्यक आहे, आणि Python आवृत्ती 3.7 किंवा त्याहून अधिक. जर Python बॅकएंड वापरत असाल, तर FFmpeg ऑडिओ प्रोसेसिंग साधन देखील इन्स्टॉल करणे आवश्यक आहे.
हार्डवेअरसाठी, गुळगुळीत स्पीच सिंथेसिस अनुभवासाठी, किमान 4GB RAM आणि दुहेरी-कोअर प्रोसेसर असलेल्या सिस्टमची शिफारस केली जाते. रिअल-टाइम स्पीच सिंथेसिस आवश्यक असलेल्या अॅप्लिकेशन्ससाठी, I/O विलंबता कमी करण्यासाठी SSD स्टोरेज वापरण्याची शिफारस केली जाते. जर मॉडेल प्रशिक्षण किंवा सानुकूल आवाज विकासाची योजना असल्यास, CUDA-सक्षम ग्राफिक्स कार्ड आवश्यक आहे.
इन्स्टॉलेशन पद्धती
FantasyTalking अनेक इन्स्टॉलेशन पद्धतींना समर्थन देते. विकसक त्यांच्या गरजा आणि तंत्रज्ञान स्टॅकनुसार सर्वात योग्य पद्धत निवडू शकतात.
npm वापरणे (Node.js)
# Install core library
npm install fantasy-talking
# Install optional components
npm install fantasy-talking-ui # Web UI components
npm install fantasy-talking-node # Node.js backend support
pip वापरणे (Python)
# Install core library
pip install fantasy-talking
# Install optional components
pip install fantasy-talking[ui] # Web UI components
pip install fantasy-talking[all] # All optional components
स्रोत कोडमधून बिल्ड करणे
# Clone repository
git clone https://github.com/fantasytalking/fantasy-talking.git
cd fantasy-talking
# Install Node.js dependencies
npm install
# Install Python dependencies (optional)
pip install -r requirements.txt
# Build project
npm run build
द्रुत सुरुवात
JavaScript/TypeScript उदाहरण
const FantasyTalking = require('fantasy-talking');
// Initialize client
const client = new FantasyTalking({
apiKey: 'your-api-key',
// Optional: specify voice style
voice: {
style: 'neutral',
language: 'en-US',
speed: 1.0,
pitch: 1.0
}
});
// Synthesize speech
async function synthesize() {
const audio = await client.speak('Hello, this is a test voice from FantasyTalking');
console.log('Speech synthesis successful');
// Save to file
const fs = require('fs');
fs.writeFileSync('output.wav', audio);
// Or play directly
client.play(audio);
}
synthesize();
Python उदाहरण
from fantasy_talking import FantasyTalking
# Initialize client
client = FantasyTalking(
api_key='your-api-key',
voice={
'style': 'neutral',
'language': 'en-US',
'speed': 1.0,
'pitch': 1.0
}
)
# Synthesize speech
audio = client.speak('Hello, this is a test voice from FantasyTalking')
# Save to file
with open('output.wav', 'wb') as f:
f.write(audio)
print('Speech synthesis successful')
कॉन्फिगरेशन पर्याय
FantasyTalking समृद्ध कॉन्फिगरेशन पर्याय पुरवते जे विशिष्ट गरजांनुसार समायोजित केले जाऊ शकतात.
मूलभूत कॉन्फिगरेशन
| पॅरामीटर | प्रकार | डीफॉल्ट | वर्णन |
|---|---|---|---|
| apiKey | string | - | API key, आवश्यक |
| apiUrl | string | Default | API सर्व्हर पत्ता |
| timeout | number | 30000 | विनंती टाइमआउट (ms) |
| retries | number | 3 | विनंती पुनर्प्रयत्न संख्या |
आवाज कॉन्फिगरेशन
| पॅरामीटर | प्रकार | डीफॉल्ट | वर्णन |
|---|---|---|---|
| voice.style | string | neutral | आवाज शैली: neutral, happy, sad, angry, excited |
| voice.language | string | en-US | भाषा कोड |
| voice.speed | number | 1.0 | भाषण गती, श्रेणी 0.5-2.0 |
| voice.pitch | number | 1.0 | पिच, श्रेणी 0.5-2.0 |
| voice.volume | number | 1.0 | व्हॉल्यूम, श्रेणी 0-1.0 |
प्रगत कॉन्फिगरेशन
प्रगत वापरकर्त्यांसाठी, अधिक सूक्ष्म नियंत्रणासाठी अधिक पॅरामीटर्स कॉन्फिगर केले जाऊ शकतात:
const client = new FantasyTalking({
apiKey: 'your-api-key',
// Audio output format
audio: {
format: 'wav', // wav, mp3, ogg
sampleRate: 16000, // 8000, 16000, 24000, 48000
bitDepth: 16 // 8, 16, 24
},
// Dialogue configuration
dialogue: {
enable: true,
contextWindow: 5, // Number of dialogue turns to preserve
systemPrompt: 'You are a friendly voice assistant'
},
// Streaming output
stream: {
enable: true,
chunkSize: 1024 // Chunk size for streaming output
}
});
सेवा तैनाती
Docker तैनाती
प्रोजेक्ट सुलभ तैनातीसाठी Docker इमेजेस पुरवते:
# Pull image
docker pull fantasytalking/server:latest
# Run container
docker run -d \
--name fantasy-talking \
-p 8080:8080 \
-e API_KEY=your-api-key \
-e PORT=8080 \
fantasytalking/server:latest
स्वयं-होस्ट केलेली सेवा
पूर्ण नियंत्रणासाठी, तुम्ही तुमची स्वतःची बॅकएंड सेवा तैनात करू शकता:
# Clone backend code
git clone https://github.com/fantasytalking/server.git
cd server
# Configure environment variables
cp .env.example .env
# Edit .env file, fill in API key and other configurations
# Start service
npm run start
सेवा सुरू झाल्यानंतर, तुम्ही RESTful API द्वारे स्पीच सिंथेसिस विनंत्या करू शकता. तपशीलवार API दस्तऐवजासाठी, कृपया अधिकृत दस्तऐवज पहा.
इन्स्टॉलेशन सत्यापित करणे
इन्स्टॉलेशननंतर, तुम्ही FantasyTalking योग्यरित्या कार्यरत आहे का सत्यापित करू शकता:
# Test with command line tool
fantasy-talking --text "Test voice" --output test.wav
# Or run example
npm run example
जर सर्वकाही कार्यरत असेल, तर तुम्हाला व्हॉइस फाइल यशस्वीरित्या व्युत्पन्न झालेली दिसेल. सामान्य इन्स्टॉलेशन समस्या आणि उपायांसाठी, कृपया FAQ पृष्ठ पहा.
