> 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.

# स्ट्रीमिंग

ElevenLabs API चुनिंदा एंडपॉइंट्स के लिए रीयल-टाइम ऑडियो स्ट्रीमिंग का समर्थन करता है। यह chunked transfer encoding का इस्तेमाल करके raw ऑडियो bytes (जैसे MP3 data) सीधे HTTP पर लौटाता है। इससे क्लाइंट्स ऑडियो बनते समय उसे धीरे-धीरे प्रोसेस या चला सकते हैं।

हमारी आधिकारिक [Node](https://github.com/elevenlabs/elevenlabs-js) और [Python](https://github.com/elevenlabs/elevenlabs-python) लाइब्रेरीज़ में इस लगातार चलने वाली ऑडियो स्ट्रीम को संभालना आसान बनाने वाली utilities शामिल हैं।

[टेक्स्ट टू स्पीच API](/docs/hi/api-reference/text-to-speech/stream), [वॉइस चेंजर API](/docs/hi/api-reference/speech-to-speech/stream) और [ऑडियो आइसोलेशन API](/docs/hi/api-reference/audio-isolation/stream) के लिए स्ट्रीमिंग समर्थित है। यह सेक्शन टेक्स्ट टू स्पीच API पर किए गए अनुरोधों के लिए स्ट्रीमिंग के काम करने के तरीके पर केंद्रित है।

Python में, स्ट्रीमिंग अनुरोध ऐसा दिखता है:

```python
from elevenlabs import stream
from elevenlabs.client import ElevenLabs

elevenlabs = ElevenLabs()

audio_stream = elevenlabs.text_to_speech.stream(
    text="This is a test",
    voice_id="JBFqnCBsd6RMkjVDRZzb",
    model_id="eleven_multilingual_v2"
)

# option 1: play the streamed audio locally
stream(audio_stream)

# option 2: process the audio bytes manually
for chunk in audio_stream:
    if isinstance(chunk, bytes):
        print(chunk)
```

Node / Typescript में, स्ट्रीमिंग अनुरोध ऐसा दिखता है:

```javascript maxLines=0
import { ElevenLabsClient, stream } from "@elevenlabs/elevenlabs-js";
import { Readable } from "stream";

const elevenlabs = new ElevenLabsClient();

async function main() {
  const audioStream = await elevenlabs.textToSpeech.stream("JBFqnCBsd6RMkjVDRZzb", {
    text: "This is a test",
    modelId: "eleven_v4",
  });

  // option 1: play the streamed audio locally
  await stream(Readable.from(audioStream));

  // option 2: process the audio manually
  for await (const chunk of audioStream) {
    console.log(chunk);
  }
}

main();
```