> 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 का इस्तेमाल

#### API कुंजी बनाएँ

[यहां डैशबोर्ड में API की बनाएं](https://elevenlabs.io/app/settings/api-keys), जिसका उपयोग आप सुरक्षित रूप से [API एक्सेस करने](/docs/hi/api-reference/authentication) के लिए करेंगे।

अपनी पसंद के अनुसार की को मैनेज्ड सीक्रेट के रूप में स्टोर करें और उसे SDKs में `.env` फ़ाइल के ज़रिए एनवायरनमेंट वेरिएबल के रूप में या सीधे अपने ऐप के कॉन्फ़िगरेशन में पास करें।

**`.env`**

```js title=".env"
ELEVENLABS_API_KEY=<your_api_key_here>
```

#### SDK इंस्टॉल करें

#### SDK

हम अपने API key को environment variable से लोड करने के लिए `dotenv` library का भी इस्तेमाल करेंगे।

```python
pip install elevenlabs
pip install python-dotenv
```

```typescript
npm install @elevenlabs/elevenlabs-js
npm install dotenv
```

#### CLI

ElevenLabs CLI इंस्टॉल करें। Homebrew (macOS) और Scoop (Windows) की सलाह दी जाती है।

**`Homebrew (macOS)`**

```bash title="Homebrew (macOS)"
brew install elevenlabs/tap/elevenlabs
```

**`Scoop (Windows)`**

```powershell title="Scoop (Windows)"
scoop bucket add elevenlabs https://github.com/elevenlabs/scoop-bucket
scoop install elevenlabs
```

**`npm`**

```bash title="npm"
npm install -g @elevenlabs/cli
```

**`curl`**

```bash title="curl"
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/elevenlabs/cli/releases/latest/download/elevenlabs-cli-installer.sh | sh
```

> **Tip**
>
> AI कोडिंग असिस्टेंट के साथ काम कर रहे हैं? अपने प्रोजेक्ट में `elevenlabs generate-skills` चलाएं। इससे हर कमांड ग्रुप के लिए `skills/` में एक
> `SKILL.md` लिखा जाएगा, ताकि आपके असिस्टेंट को डॉक्यूमेंटेशन पेस्ट किए बिना CLI की पूरी जानकारी मिल सके। उन्हें कहीं और रखने के लिए `--output-dir` इस्तेमाल करें। यह CLI की अपनी
> एम्बेडेड API डेफ़िनिशन पढ़ता है, इसलिए इसे API key की ज़रूरत नहीं होती और यह ऑफ़लाइन भी काम करता है — साथ ही आपके इंस्टॉल किए गए CLI वर्शन के अनुसार बना रहता है।

फिर authenticate करें — CLI को authorize करने के लिए इससे आपका browser खुलेगा:

```bash
elevenlabs auth login
```

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

#### SDK

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

```python maxLines=0
# example.py
import os
from io import BytesIO
from elevenlabs.client import ElevenLabs
import requests
from dotenv import load_dotenv

load_dotenv()

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

audio_url = (
    "https://storage.googleapis.com/eleven-public-cdn/audio/marketing/nicole.mp3"
)
response = requests.get(audio_url)
audio_data = BytesIO(response.content)

# Perform the text-to-speech conversion
transcription = elevenlabs.forced_alignment.create(
    file=audio_data,
    text="With a soft and whispery American accent, I'm the ideal choice for creating ASMR content, meditative guides, or adding an intimate feel to your narrative projects."
)

print(transcription)
```

```typescript maxLines=0
// example.ts
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import "dotenv/config";
const elevenlabs = new ElevenLabsClient();

const response = await fetch(
    "https://storage.googleapis.com/eleven-public-cdn/audio/marketing/nicole.mp3"
);
const audioBlob = new Blob([await response.arrayBuffer()], { type: "audio/mp3" });

const transcript = await elevenlabs.forcedAlignment.create({
    file: audioBlob,
    text: "With a soft and whispery American accent, I'm the ideal choice for creating ASMR content, meditative guides, or adding an intimate feel to your narrative projects."
})

console.log(transcript);
```

फिर इसे चलाएँ:

```python
python example.py
```

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

आपको कंसोल में सटीक टाइमस्टैम्प के साथ ऑडियो फ़ाइल का ट्रांसक्रिप्ट प्रिंट होता दिखना चाहिए।

#### CLI

सैंपल ऑडियो डाउनलोड करें, फिर उसे ट्रांसक्रिप्ट के साथ अलाइन करें:

```bash
curl -O https://storage.googleapis.com/eleven-public-cdn/audio/marketing/nicole.mp3

elevenlabs forced-alignment create \
  --file nicole.mp3 \
  --text "With a soft and whispery American accent, I'm the ideal choice for creating ASMR content, meditative guides, or adding an intimate feel to your narrative projects."
```

हर शब्द के टाइमस्टैम्प के साथ अलाइनमेंट आपके टर्मिनल में प्रिंट होता है।

## अगले चरण

#### [स्पीच टू टेक्स्ट](/docs/hi/eleven-api/guides/cookbooks/speech-to-text)

मौजूदा ट्रांसक्रिप्ट के बिना ऑडियो को टेक्स्ट में ट्रांसक्राइब करें

#### [टेक्स्ट टू स्पीच](/docs/hi/eleven-api/guides/cookbooks/text-to-speech)

फ़ोर्स्ड अलाइनमेंट में इस्तेमाल के लिए टेक्स्ट से ऑडियो जनरेट करें

#### [API रेफरेंस](/docs/hi/api-reference/forced-alignment/create)

फ़ोर्स्ड अलाइनमेंट के सभी पैरामीटर और रिस्पॉन्स फ़ॉर्मैट देखें