> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# वॉइस डिज़ाइन क्विकस्टार्ट

यह गाइड आपको वॉइस डिज़ाइन API का इस्तेमाल करके प्रॉम्प्ट से वॉइस डिज़ाइन करने का तरीका दिखाएगी।

## वॉइस डिज़ाइन API का इस्तेमाल

> **Note**
>
> यह गाइड मानती है कि आपने [अपनी API कुंजी और SDK सेट अप कर ली है](/docs/hi/eleven-api/quickstart)। अगर आपने अभी तक नहीं किया है, तो पहले
> क्विकस्टार्ट पूरा करें। अपने स्पीकर्स से ऑडियो चलाने के लिए आपको
> [MPV](https://mpv.io/) और/या [ffmpeg](https://ffmpeg.org/) की भी ज़रूरत पड़ सकती है।

#### API रिक्वेस्ट करें

प्रॉम्प्ट के ज़रिए वॉइस डिज़ाइन करने के दो चरण होते हैं:

1. प्रॉम्प्ट के आधार पर प्रीव्यू जनरेट करें।
2. सबसे अच्छा प्रीव्यू चुनें और उससे नई वॉइस बनाएं।

हम प्रॉम्प्ट के आधार पर प्रीव्यू जनरेट करने से शुरू करेंगे।

अपनी पसंद की भाषा के अनुसार `example.py` या `example.mts` नाम की नई फ़ाइल बनाएं और इसमें यह कोड जोड़ें:

```python maxLines=0
# example.py
from dotenv import load_dotenv
from elevenlabs.client import ElevenLabs
from elevenlabs.play import play
import base64

load_dotenv()

elevenlabs = ElevenLabs(
  api_key=os.getenv("ELEVENLABS_API_KEY"),
)

voices = elevenlabs.text_to_voice.design(
    model_id="eleven_multilingual_ttv_v2",
    voice_description="A massive evil ogre speaking at a quick pace. He has a silly and resonant tone.",
    text="Your weapons are but toothpicks to me. Surrender now and I may grant you a swift end. I've toppled kingdoms and devoured armies. What hope do you have against me?",
)

for preview in voices.previews:
    # Convert base64 to audio buffer
    audio_buffer = base64.b64decode(preview.audio_base_64)

    print(f"Playing preview: {preview.generated_voice_id}")

    play(audio_buffer)
```

```typescript maxLines=0
// example.ts
import { ElevenLabsClient, play } from "@elevenlabs/elevenlabs-js";
import "dotenv/config";
import { Readable } from 'node:stream';
import { Buffer } from 'node:buffer';

const elevenlabs = new ElevenLabsClient();

const { previews } = await elevenlabs.textToVoice.design({
    modelId: "eleven_multilingual_ttv_v2",
    voiceDescription: "A massive evil ogre speaking at a quick pace. He has a silly and resonant tone.",
    text: "Your weapons are but toothpicks to me. Surrender now and I may grant you a swift end. I've toppled kingdoms and devoured armies. What hope do you have against me?",
});

for (const preview of previews) {
    // Convert base64 to buffer and create a Readable stream
    const audioStream = Readable.from(Buffer.from(preview.audioBase64, 'base64'));

    console.log(`Playing preview: ${preview.generatedVoiceId}`);

    // Play the audio using the stream
    await play(audioStream);
}
```

#### कोड चलाएं

```python
python example.py
```

```typescript
npx tsx example.mts
```

आपको अपने स्पीकर्स से जनरेट किए गए वॉइस प्रीव्यू एक-एक करके सुनाई देने चाहिए।

#### जनरेट की गई वॉइस को अपनी लाइब्रेरी में जोड़ें

प्रीव्यू जनरेट करने और अपना पसंदीदा चुनने के बाद, आप उसे जनरेट की गई वॉइस ID के ज़रिए अपनी वॉइस लाइब्रेरी में जोड़ सकते हैं, ताकि उसे अन्य API के साथ इस्तेमाल किया जा सके।

```python
voice = elevenlabs.text_to_voice.create(
    voice_name="Jolly giant",
    voice_description="A huge giant, at least as tall as a building. A deep booming voice, loud and jolly.",
    # The generated voice ID of the preview you want to use,
    # using the first in the list for this example
    generated_voice_id=voices.previews[0].generated_voice_id
)

print(voice.voice_id)
```

```typescript
const voice = await elevenlabs.textToVoice.create({
    voiceName: "Jolly giant",
    voiceDescription: "A huge giant, at least as tall as a building. A deep booming voice, loud and jolly.",
    // The generated voice ID of the preview you want to use,
    // using the first in the list for this example
    generatedVoiceId: previews[0].generatedVoiceId
});

// The ID of the newly created voice, use this to reference the voice in other APIs
console.log(voice.voiceId);
```

## अगले चरण

#### [इंस्टेंट वॉइस क्लोनिंग](/docs/hi/eleven-api/guides/how-to/voices/instant-voice-cloning)

विवरण से वॉइस जनरेट करने के बजाय मौजूदा ऑडियो से वॉइस क्लोन करें।

#### [API रेफरेंस](/docs/hi/api-reference/text-to-voice/design)

पूरा वॉइस डिज़ाइन API रेफरेंस और पैरामीटर।