Streaming

Murf TTS API supports real-time streaming capabilities, allowing developers to generate and play text-to-speech (TTS) audio dynamically as it is being generated in real-time, reducing the time-to-first-byte. This ensures minimal latency, making it ideal for conversational AI, real-time applications, and voice-enabled assistants.

New: Pass model = falcon-2 to use our Falcon 2 model in text-to-speech streaming endpoints, designed for ultra-low latency (~130 ms).

In addition to HTTP streaming endpoint, Murf TTS supports Websocket streaming which enables bidirectional streaming for real-time audio generation.

Quickstart

Streaming enables returning raw audio bytes (e.g., MP3 data) directly over HTTP using chunked transfer encoding. This allows clients to process or play audio incrementally as it is generated. This section focuses on how streaming works for requests made to the Text to Speech API.

1

Getting Started

Generate an API key here. Store the key in a secure location, as you’ll need it to authenticate your requests. You can optionally save the key as an environment variable in your terminal.

2

Initiating a Streaming Request

Install the Python SDK and PyAudio

pyaudio depends on PortAudio, you may need to install it first.

PyAudio depends on PortAudio, a cross-platform audio I/O library. You may need to install PortAudio separately if it’s not already on your system.

$brew install portaudio

Once you have installed PortAudio, you can install the required Python packages using the following command:

$pip install murf pyaudio

Make the API Call with Real-Time Playback

Once you have the SDK and PyAudio installed, and the API key set as an environment variable, you are ready to make your first streaming API call with real-time audio playback.

1import pyaudio
2from murf import Murf, MurfRegion
3
4client = Murf(
5 api_key="YOUR_API_KEY", # Not required if you have set the MURF_API_KEY environment variable
6 region=MurfRegion.GLOBAL
7)
8
9# For lower latency, specify a region closer to your users
10# client = Murf(region=MurfRegion.IN) # Example: India region
11
12# Audio format settings (must match your API output)
13SAMPLE_RATE = 24000
14CHANNELS = 1
15FORMAT = pyaudio.paInt16
16
17def play_streaming_audio():
18 # Get the streaming audio generator
19 audio_stream = client.text_to_speech.stream(
20 text="Hi, How are you doing today?",
21 voice_id="Matthew",
22 model="falcon-2",
23 locale="en-US",
24 sample_rate=SAMPLE_RATE,
25 format="PCM"
26 )
27
28 # Setup audio stream for playback
29 pa = pyaudio.PyAudio()
30 stream = pa.open(format=FORMAT, channels=CHANNELS, rate=SAMPLE_RATE, output=True)
31
32 try:
33 print("Starting audio playback...")
34 for chunk in audio_stream:
35 if chunk: # Check if chunk has data
36 stream.write(chunk)
37 except Exception as e:
38 print(f"Error during streaming: {e}")
39 finally:
40 stream.stop_stream()
41 stream.close()
42 pa.terminate()
43 print("Audio streaming and playback complete!")
44
45if __name__ == "__main__":
46 play_streaming_audio()

Falcon 2 Supported Voices

Voice IDSupported LocalesVoice Styles
Aliciaen-US (English - US & Canada), es-ES (Spanish - Spain), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversation
Alinaen-US (English - US & Canada)Conversational
Arianaen-US (English - US & Canada)Conversation
Caleben-US (English - US & Canada)Conversation
Daisyen-US (English - US & Canada)Conversation
Delilahen-US (English - US & Canada)Conversational
Edmunden-US (English - US & Canada)Conversation
Ezekielen-US (English - US & Canada)Conversational
Gordonen-US (English - US & Canada)Conversational
Harolden-US (English - US & Canada)Conversational
Heatheren-US (English - US & Canada)Conversational
Isabelleen-US (English - US & Canada)Conversational
Jaydenen-US (English - US & Canada)Conversation
Jonathanen-US (English - US & Canada)Conversational
Judithen-US (English - US & Canada)Conversational
Lillianen-US (English - US & Canada)Conversational
Lunaen-US (English - US & Canada)Conversational
Madisonen-US (English - US & Canada)Conversational
Matthewen-US (English - US & Canada), es-MX (Spanish - Mexico)Conversation
Milesen-US (English - US & Canada), de-DE (German - Germany), es-ES (Spanish - Spain), fr-FR (French - France), it-IT (Italian - Italy)Customer Support Agent
Natalieen-US (English - US & Canada), es-ES (Spanish - Spain), fr-FR (French - France), it-IT (Italian - Italy)Conversation
Oliviaen-US (English - US & Canada)Conversational
Willen-US (English - US & Canada)Conversation
Axelen-US (English - US & Canada)Narration
Benícioen-US (English - US & Canada), pt-BR (Portuguese - Brazil)Conversational
Björnen-US (English - US & Canada), de-DE (German - Germany)Narration
Blazejen-US (English - US & Canada), pl-PL (Polish - Poland)Narration
Dirken-US (English - US & Canada), nl-NL (Dutch - Netherlands)Conversational, Narration
Emilyen-US (English - US & Canada), en-SCOTT (English - Scotland)Narration
Gretaen-US (English - US & Canada)Conversational
Isadoraen-US (English - US & Canada), pt-BR (Portuguese - Brazil)Conversational
Jimmen-US (English - US & Canada), de-DE (German - Germany), en-AU (English - Australia), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Narration, Promo, Conversational
Voice IDSupported LocalesVoice Styles
Benedicten-UK (English - UK)Conversational
Jakeen-UK (English - UK)Conversational
Lydiaen-UK (English - UK)Conversational
Voice IDSupported LocalesVoice Styles
Abhinaven-IN (English - India), hi-IN (Hindi - India)Conversational
Anishaen-IN (English - India)Conversation
Anushaen-IN (English - India)Conversational
Nikhilen-IN (English - India)Conversational
Palaken-IN (English - India)Conversational
Poojaen-IN (English - India)Conversational
Samaren-IN (English - India)Conversational
Voice IDSupported LocalesVoice Styles
Harperen-AU (English - Australia)Conversational
Ivyen-AU (English - Australia)Conversational
Jimmen-AU (English - Australia), de-DE (German - Germany), en-US (English - US & Canada), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Kylieen-AU (English - Australia), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Leytonen-AU (English - Australia)Conversational
Voice IDSupported LocalesVoice Styles
Guillaumefr-FR (French - France)Conversational
Jimmfr-FR (French - France), de-DE (German - Germany), en-AU (English - Australia), en-US (English - US & Canada), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Kyliefr-FR (French - France), en-AU (English - Australia), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), hi-IN (Hindi - India), it-IT (Italian - Italy)Promo, Conversational
Milesfr-FR (French - France), de-DE (German - Germany), en-US (English - US & Canada), es-ES (Spanish - Spain), it-IT (Italian - Italy)Conversational
Nataliefr-FR (French - France), en-US (English - US & Canada), es-ES (Spanish - Spain), it-IT (Italian - Italy)Promo
Voice IDSupported LocalesVoice Styles
Alexisfr-CA (French - Canada)Conversational
Voice IDSupported LocalesVoice Styles
Björnde-DE (German - Germany), en-US (English - US & Canada)Conversational
Ernade-DE (German - Germany)Conversational
Larade-DE (German - Germany)Conversational
Ralfde-DE (German - Germany)Conversational
Jimmde-DE (German - Germany), en-AU (English - Australia), en-US (English - US & Canada), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Promo, Conversational
Justinede-DE (German - Germany)Narration
Milesde-DE (German - Germany), en-US (English - US & Canada), es-ES (Spanish - Spain), fr-FR (French - France), it-IT (Italian - Italy)Promo
Voice IDSupported LocalesVoice Styles
Carloses-MX (Spanish - Mexico)Conversational
Luisaes-MX (Spanish - Mexico)Conversational
Valeriaes-MX (Spanish - Mexico)Conversational
Kyliees-MX (Spanish - Mexico), en-AU (English - Australia), es-ES (Spanish - Spain), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Matthewes-MX (Spanish - Mexico), en-US (English - US & Canada)Conversation
Voice IDSupported LocalesVoice Styles
Carmenes-ES (Spanish - Spain)Conversational
Javieres-ES (Spanish - Spain)Conversational
Aliciaes-ES (Spanish - Spain), en-US (English - US & Canada), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Kyliees-ES (Spanish - Spain), en-AU (English - Australia), es-MX (Spanish - Mexico), fr-FR (French - France), hi-IN (Hindi - India), it-IT (Italian - Italy)Conversational
Mileses-ES (Spanish - Spain), de-DE (German - Germany), en-US (English - US & Canada), fr-FR (French - France), it-IT (Italian - Italy)Promo
Nataliees-ES (Spanish - Spain), en-US (English - US & Canada), fr-FR (French - France), it-IT (Italian - Italy)Promo, Conversational
Voice IDSupported LocalesVoice Styles
Angeloit-IT (Italian - Italy)Conversational
Aliciait-IT (Italian - Italy), en-US (English - US & Canada), es-ES (Spanish - Spain), hi-IN (Hindi - India)Conversational
Jimmit-IT (Italian - Italy), de-DE (German - Germany), en-AU (English - Australia), en-US (English - US & Canada), fr-FR (French - France), hi-IN (Hindi - India)Conversational
Kylieit-IT (Italian - Italy), en-AU (English - Australia), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), fr-FR (French - France), hi-IN (Hindi - India)Conversational
Milesit-IT (Italian - Italy), de-DE (German - Germany), en-US (English - US & Canada), es-ES (Spanish - Spain), fr-FR (French - France)Conversational
Natalieit-IT (Italian - Italy), en-US (English - US & Canada), es-ES (Spanish - Spain), fr-FR (French - France)Conversational
Voice IDSupported LocalesVoice Styles
Beníciopt-BR (Portuguese - Brazil), en-US (English - US & Canada)Conversational
Eloapt-BR (Portuguese - Brazil)Conversational
Gustavopt-BR (Portuguese - Brazil)Conversational
Heitorpt-BR (Portuguese - Brazil)Conversational
Isadorapt-BR (Portuguese - Brazil), en-US (English - US & Canada)Conversational
Silviopt-BR (Portuguese - Brazil)Conversational
Yagopt-BR (Portuguese - Brazil)Conversational
Voice IDSupported LocalesVoice Styles
Jiaozh-CN (Mandarin - China)Conversational
Taozh-CN (Mandarin - China)Conversational
Weizh-CN (Mandarin - China)Conversational
Yuxanzh-CN (Mandarin - China)Conversational
Voice IDSupported LocalesVoice Styles
Dirknl-NL (Dutch - Netherlands), en-US (English - US & Canada)Conversational
Famkenl-NL (Dutch - Netherlands)Conversational
Merelnl-NL (Dutch - Netherlands)Conversational
Voice IDSupported LocalesVoice Styles
Amanhi-IN (Hindi - India)Conversational
Anjalihi-IN (Hindi - India)Conversational
Karanhi-IN (Hindi - India)Conversational
Khyatihi-IN (Hindi - India)Conversational
Namritahi-IN (Hindi - India), kn-IN (Kannada - India)Conversational
Shreyahi-IN (Hindi - India)Conversational
Sunainahi-IN (Hindi - India)Conversational
Abhinavhi-IN (Hindi - India), en-IN (English - India)Conversational
Aliciahi-IN (Hindi - India), en-US (English - US & Canada), es-ES (Spanish - Spain), it-IT (Italian - Italy)Conversational
Jimmhi-IN (Hindi - India), de-DE (German - Germany), en-AU (English - Australia), en-US (English - US & Canada), fr-FR (French - France), it-IT (Italian - Italy)Conversational
Kyliehi-IN (Hindi - India), en-AU (English - Australia), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), fr-FR (French - France), it-IT (Italian - Italy)Conversational
Voice IDSupported LocalesVoice Styles
Jangmiko-KR (Korean - South Korea)Conversational
Jong-suko-KR (Korean - South Korea)Conversational
Voice IDSupported LocalesVoice Styles
Latikata-IN (Tamil - India)Conversational
Romeshta-IN (Tamil - India)Conversational
Voice IDSupported LocalesVoice Styles
Blazejpl-PL (Polish - Poland), en-US (English - US & Canada)Conversational
Jacekpl-PL (Polish - Poland)Conversational
Kasiapl-PL (Polish - Poland)Conversational
Voice IDSupported LocalesVoice Styles
Debaratibn-IN (Bangla - India)Conversational
Subhankarbn-IN (Bangla - India)Conversational
Voice IDSupported LocalesVoice Styles
Denkija-JP (Japanese - Japan)Conversational
Kenjija-JP (Japanese - Japan)Conversational
Kimija-JP (Japanese - Japan)Conversational
Voice IDSupported LocalesVoice Styles
Diyagu-IN (Gujarati - India)Conversational
Hardikgu-IN (Gujarati - India)Conversational
Voice IDSupported LocalesVoice Styles
Darshankn-IN (Kannada - India)Conversational
Namritakn-IN (Kannada - India), hi-IN (Hindi - India)Conversational
Voice IDSupported LocalesVoice Styles
Madhavanml-IN (Malayalam - India)Conversational
Nimishaml-IN (Malayalam - India)Conversational
Voice IDSupported LocalesVoice Styles
Prajaktamr-IN (Marathi - India)Conversational
Prathameshmr-IN (Marathi - India)Conversational
Vaibhavmr-IN (Marathi - India)Conversational
Voice IDSupported LocalesVoice Styles
Harmanpa-IN (Punjabi - India)Conversational
Voice IDSupported LocalesVoice Styles
Keshavte-IN (Telugu - India)Conversational
Navyate-IN (Telugu - India)Conversational
Vaishnavite-IN (Telugu - India)Conversational

Endpoint & Concurrency Overview

Endpoint baseConcurrency cap
https://global.api.murf.ai/v1/speech/stream15 (if nearest server is US-East) / 2 (all other regions)
https://<region>.api.murf.ai/v1/speech/stream (see regions below)15 for US-East / 2 for all other regions

The Global Router automatically picks the nearest region automatically.The concurrency limit is 15 for the US-East region and 2 for all other regions. To get higher concurrency, use the US-East endpoint directly or contact us to increase limits for regional endpoints.

Available Regions

Use the region closest to your users for the lowest latency.

Region (City/Area)Endpoint
Global (Routes to the nearest server)https://global.api.murf.ai/v1/speech/stream
US-Easthttps://us-east.api.murf.ai/v1/speech/stream
US-Westhttps://us-west.api.murf.ai/v1/speech/stream
Indiahttps://in.api.murf.ai/v1/speech/stream
Canadahttps://ca.api.murf.ai/v1/speech/stream
South Koreahttps://kr.api.murf.ai/v1/speech/stream
UAEhttps://me.api.murf.ai/v1/speech/stream
Japanhttps://jp.api.murf.ai/v1/speech/stream
Australiahttps://au.api.murf.ai/v1/speech/stream
EU (Central)https://eu-central.api.murf.ai/v1/speech/stream
UKhttps://uk.api.murf.ai/v1/speech/stream
South America (São Paulo)https://sa-east.api.murf.ai/v1/speech/stream

FAQs

Falcon 2 is our fastest streaming model (~130 ms latency) optimized for real-time interactions.

Use Falcon 2 when your top priority is ultra-low latency. Typical fits include: - Conversational agents & live support where snappy turn-taking matters. - Real-time apps (IVR, gaming, tutoring, assistive tech) that stream audio as users speak. - Interruptible/barge-in experiences and interactive demos or prototyping.

Include model = falcon-2 in your request (HTTP or WebSocket). If omitted, the default streaming model is used.

In streaming mode, you can control the voice, style, pitch, speed, and locale in both Gen2 and Falcon 2 models. The Gen2 model also supports pause tags.

  • We support MP3, FLAC, WAV, ALAW, ULAW, OGG, and PCM. - If you need to transmit audio as text, you can Base64-encode any of these.