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 पृष्ठ देखें।
