Skip to content

ElevenLabs TTS Operator

The ElevenLabs TTS LOP generates high-quality, natural-sounding speech from text using the ElevenLabs API. It utilizes WebSockets for low-latency audio streaming directly into a TouchDesigner CHOP, making it suitable for real-time applications. It also supports saving the generated audio to local files and recalling previously generated audio from ElevenLabs’ history or local cache.

ElevenLabs TTS UI

  • Python Packages:
    • websockets: For streaming audio.
    • requests: For fetching voices and history.
    • numpy: For audio data handling.
    • soundfile: For saving audio files (install via pip install soundfile).
    • Install these via the ChatTD Python Manager.
  • ChatTD Operator: Required for dependency management, API key storage (optional), and asynchronous task execution. Ensure the ChatTD Operator parameter on the ‘About’ page points to your configured ChatTD instance.
  • ElevenLabs API Key: A valid API key from your ElevenLabs account.
  • Input DAT (input_message, optional): If Text Input Source is set to input_dat, the text content of this DAT is used for synthesis.
  • Output CHOP (null_audio_out -> store_output): Contains the streamed or loaded audio data (mono, 24kHz).
  • History DAT (history_dat): Internal table logging local generation jobs initiated by this operator.
  • API History DAT (api_history_dat): Internal table mirroring recent history items fetched from the ElevenLabs API.
  • Local History DAT (local_history_dat): Internal table listing locally saved audio files generated by this operator.
  • Voices DAT (voices_dat): Internal table listing available voices fetched from the API.
  • Saved Audio Files: Audio can be saved locally (WAV or OGG) in the specified Save Folder.
  • Saved Metadata Files: JSON files containing details about each saved generation are stored in a metadata subfolder within the ElevenLabs config directory.
ElevenLabs API Key (Apikey) op('tts_elevenlabs').par.Apikey Str
Default:
None
Get API Key (Getapikey) op('tts_elevenlabs').par.Getapikey Pulse
Default:
None
Fetch Available Voices (Getvoices) op('tts_elevenlabs').par.Getvoices Pulse
Default:
None
Voice (Voiceid) op('tts_elevenlabs').par.Voiceid Menu
Default:
None
Model (Modelid) op('tts_elevenlabs').par.Modelid Menu
Default:
eleven_multilingual_v2
Options:
eleven_multilingual_v2, eleven_turbo_v2, eleven_monolingual_v1, eleven_multilingual_v1, eleven_flash_v2_5
Stability (Stability) op('tts_elevenlabs').par.Stability Float
Default:
0
Range:
0 to 1
Slider Range:
0 to 1
Similarity Boost (Similarityboost) op('tts_elevenlabs').par.Similarityboost Float
Default:
0
Range:
0 to 1
Slider Range:
0 to 1
Use Speaker Boost (Usespeakerboost) op('tts_elevenlabs').par.Usespeakerboost Toggle
Default:
Off
Text Input Source (Textinput) op('tts_elevenlabs').par.Textinput Menu
Default:
parameter
Options:
parameter, input_dat
Text to Speak (Text) op('tts_elevenlabs').par.Text Str
Default:
None
Start Streaming (Stream) op('tts_elevenlabs').par.Stream Pulse
Default:
None
Stop Streaming (Stop) op('tts_elevenlabs').par.Stop Pulse
Default:
None
Clear Stored Audio (Clearaudio) op('tts_elevenlabs').par.Clearaudio Pulse
Default:
None
Status (Status) op('tts_elevenlabs').par.Status Str
Default:
None
Active (Active) op('tts_elevenlabs').par.Active Toggle
Default:
None
Playing (Playing) op('tts_elevenlabs').par.Playing Toggle
Default:
None
Start Playback (Playstart) op('tts_elevenlabs').par.Playstart Pulse
Default:
None
Enable Playback Control (Play) op('tts_elevenlabs').par.Play Toggle
Default:
Off
Play on Result (Playonresult) op('tts_elevenlabs').par.Playonresult Toggle
Default:
Off
Check Credits (Checkcredits) op('tts_elevenlabs').par.Checkcredits Pulse
Default:
None
Credit Info (Creditinfo) op('tts_elevenlabs').par.Creditinfo Str
Default:
None
Audio Device Settings Header
Active (Audioactive) op('tts_elevenlabs').par.Audioactive Toggle
Default:
On
Driver (Driver) op('tts_elevenlabs').par.Driver Menu
Default:
default
Options:
default, asio
Device (Device) op('tts_elevenlabs').par.Device Menu
Default:
default
Options:
default, {0.0.0.00000000}.{d7b929aa-ec27-4f96-bd39-78d6a8c2044a}||Out_1-2_(MOTU_M_Series)||1, {0.0.0.00000000}.{0f011619-4954-432e-b132-2653e7136839}||LEN_P32u-10_(NVIDIA_High_Definition_Audio)||2, {0.0.0.00000000}.{10c42639-6ae9-4121-ad66-04d4f850c7e6}||VBMatrix_In_7_(VB-Audio_Matrix_VAIO)||3, {0.0.0.00000000}.{372fb62b-07aa-4580-b062-2c6adba187e7}||Out_3-4_(MOTU_M_Series)||4, {0.0.0.00000000}.{3f0d389a-29d3-415d-a9ba-20773d212885}||VBMatrix_In_6_(VB-Audio_Matrix_VAIO)||5, {0.0.0.00000000}.{55a6de81-1fa3-4b2e-bced-71880481eb62}||VBMatrix_In_8_(VB-Audio_Matrix_VAIO)||6, {0.0.0.00000000}.{6f55253a-13a1-40f9-9f80-762ce203338b}||VBMatrix_In_3_(VB-Audio_Matrix_VAIO)||7, {0.0.0.00000000}.{762727ea-ca22-466b-9f2a-c6ca2d6d9648}||VBMatrix_In_1_(VB-Audio_Matrix_VAIO)||8, {0.0.0.00000000}.{7c163c65-5cda-4fbd-971b-27e1c3b471f0}||F13NA_(NVIDIA_High_Definition_Audio)||9, {0.0.0.00000000}.{ad8837d6-c905-4a72-adcb-7018ee7baab3}||CABLE_Input_(VB-Audio_Virtual_Cable)||10, {0.0.0.00000000}.{b3dcef2a-cec9-4686-ae78-79573bf3df3e}||VBMatrix_In_4_(VB-Audio_Matrix_VAIO)||11, {0.0.0.00000000}.{b6526f47-8c31-48d5-8b30-489196c56a6b}||Headphones_(iLoud_Micro-Monitor)||12, {0.0.0.00000000}.{cc818f2b-580f-4915-ad18-53412c5378fa}||VBMatrix_In_5_(VB-Audio_Matrix_VAIO)||13, {0.0.0.00000000}.{deaebd99-08fa-47eb-bac0-864267bd9522}||DELL_S2415H_(NVIDIA_High_Definition_Audio)||14, {0.0.0.00000000}.{df2e555b-b4ef-4656-921f-6272a16b48a7}||VBMatrix_In_2_(VB-Audio_Matrix_VAIO)||15
Volume (Volume) op('tts_elevenlabs').par.Volume Float
Default:
1
Range:
0 to 1
Slider Range:
0 to 1
Save Audio To File Header
Auto Save To Disk (Autosavetodisk) op('tts_elevenlabs').par.Autosavetodisk Toggle
Default:
Off
Output Folder (Folder) op('tts_elevenlabs').par.Folder Folder
Default:
"" (Empty String)
Base Name (Name) op('tts_elevenlabs').par.Name Str
Default:
None
File Type (Filetype) op('tts_elevenlabs').par.Filetype Menu
Default:
wav
Options:
wav, mp3, ogg
Auto Version (Autoversion) op('tts_elevenlabs').par.Autoversion Toggle
Default:
On
Save Current Audio (Savefile) op('tts_elevenlabs').par.Savefile Pulse
Default:
None
CHOP Outputs Header
Output 1 (CHOP) (Out2chop) op('tts_elevenlabs').par.Out2chop Menu
Default:
playback
Options:
playback, full_audio
Update History (Fetchhistory) op('tts_elevenlabs').par.Fetchhistory Pulse
Default:
None
Audio to Load (Generationid) op('tts_elevenlabs').par.Generationid Menu
Default:
None
Select From (Selectfrom) op('tts_elevenlabs').par.Selectfrom Menu
Default:
all
Options:
all, all_local, project_only
Display (Display) op('tts_elevenlabs').par.Display Menu
Default:
job_id
Options:
job_id, text, timestamp, local_file, name
Load Audio File (Loadfile) op('tts_elevenlabs').par.Loadfile Pulse
Default:
None
Enable History Playback (Playbackfromhistory) op('tts_elevenlabs').par.Playbackfromhistory Toggle
Default:
Off
Playing History Item (Playinghistory) op('tts_elevenlabs').par.Playinghistory Toggle
Default:
None
Loaded Audio File Path (Audiofilepath) op('tts_elevenlabs').par.Audiofilepath Str
Default:
None
Callbacks Header
Callback DAT (Callbackdat) op('tts_elevenlabs').par.Callbackdat DAT
Default:
ChatTD_callbacks
Create Callbacks (Createcallbacks) op('tts_elevenlabs').par.Createcallbacks Pulse
Default:
None
onGenerate (Ongenerate) op('tts_elevenlabs').par.Ongenerate Toggle
Default:
Off
onDone (Ondone) op('tts_elevenlabs').par.Ondone Toggle
Default:
Off
onPlayStart (Onplaystart) op('tts_elevenlabs').par.Onplaystart Toggle
Default:
Off
onPlayEnd (Onplayend) op('tts_elevenlabs').par.Onplayend Toggle
Default:
Off
onSave (Onsave) op('tts_elevenlabs').par.Onsave Toggle
Default:
Off
Textport Debug Callbacks (Debugcallbacks) op('tts_elevenlabs').par.Debugcallbacks Menu
Default:
Full Details
Options:
None, Errors Only, Basic Info, Full Details
Available Callbacks:
  • onGenerate
  • onDone
  • onPlayStart
  • onPlayEnd
  • onSave
Example Callback Structure:
def onGenerate(info):
# Called before streaming starts
# info: {'job_id', 'text', 'voice_id', 'model_id'}
print(f"Starting generation job: {info.get('job_id')}")

def onDone(info):
# Called when streaming finishes or errors
# info: {'job_id', 'status', 'message', 'duration', 'text', 'voice_id', 'model_id'}
print(f"Generation finished: {info.get('status')} ({info.get('duration')}s)")

def onPlayStart(info):
# Called when playback starts
# info: {'job_id', 'audio_duration', 'text'}
print(f"Playback started for job: {info.get('job_id')}")

def onPlayEnd(info):
# Called when playback ends
# info: {'job_id', 'audio_duration', 'text'}
print(f"Playback finished for job: {info.get('job_id')}")

def onSave(info):
# Called after audio is saved successfully
# info: {'job_id', 'filepath', 'filename', 'folder', 'duration', 'text'}
print(f"Audio saved to: {info.get('filepath')}")
Bypass (Bypass) op('tts_elevenlabs').par.Bypass Toggle
Default:
Off
Show Built-in Parameters (Showbuiltin) op('tts_elevenlabs').par.Showbuiltin Toggle
Default:
Off
Version (Version) op('tts_elevenlabs').par.Version Str
Default:
None
Last Updated (Lastupdated) op('tts_elevenlabs').par.Lastupdated Str
Default:
None
Creator (Creator) op('tts_elevenlabs').par.Creator Str
Default:
None
Website (Website) op('tts_elevenlabs').par.Website Str
Default:
None
ChatTD Operator (Chattd) op('tts_elevenlabs').par.Chattd OP
Default:
None
Clear Log (Clearlog) op('tts_elevenlabs').par.Clearlog Pulse
Default:
None
Convert To Text (Converttotext) op('tts_elevenlabs').par.Converttotext Toggle
Default:
Off
  1. Enter your ElevenLabs API Key.
  2. Pulse ‘Fetch Available Voices’ and select a voice from the ‘Voice’ menu.
  3. Select a desired ‘Model’.
  4. Keep ‘Text Input Source’ as ‘parameter’.
  5. Enter text in ‘Text to Speak’.
  6. Ensure ‘Play on Result’ is ON.
  7. Pulse ‘Start Streaming’. Audio should stream in and play automatically.
  1. Set ‘Text Input Source’ to ‘input_dat’.
  2. Create a Text DAT and connect it to the first input of the ElevenLabs operator.
  3. Enter text into the Text DAT.
  4. Pulse ‘Start Streaming’.
  1. Ensure ‘Auto Save To Disk’ is ON.
  2. Specify an ‘Output Folder’.
  3. Optionally change the ‘Base Name’ (use $JOBID for uniqueness) and ‘File Type’.
  4. Run streaming as usual (e.g., Pulse ‘Start Streaming’).
  5. After successful streaming, the audio and metadata files will appear in the specified folder.
  1. Pulse ‘Update History’ to fetch recent items from the API and local storage.
  2. Select an item from the ‘Audio to Load’ menu.
  3. Pulse ‘Load Audio File’. Check ‘Status’ and ‘Loaded Audio File Path’.
  4. Enable ‘Enable History Playback’.
  5. Use the standard ‘Start Playback’ pulse to play the loaded audio.
  • Streaming: Uses WebSockets for low-latency audio delivery (PCM format, 24kHz sample rate).
  • API Key: Stored securely in a local configuration file (elevenlabs_config.json) within the ChatTD environment or project folder.
  • Dependencies: Requires websockets, requests, numpy, soundfile.
  • Asynchronous: All API communication (streaming, voice fetch, history fetch, credit check) happens asynchronously via ChatTD to avoid blocking TouchDesigner.
  • Saving: Audio saved locally requires the soundfile library. Metadata is saved in JSON format.
  • History: Fetches history from the ElevenLabs API (limited items) and scans local save folder for generated files.
  • Playback: Uses an internal Audio Device Out CHOP configured via the Playback page parameters.
  • ChatTD: Provides core services like dependency management and asynchronous task execution.