# SpeechT5 TTS — card for AI agents

MIT-licensed English TTS fine-tuned on LibriTTS; the voice is set by a speaker x-vector embedding.

Category: Voiceover (text-to-speech) · maker Microsoft · checked 2026-10-25

## Price
- Price: Free
- Free tier: Open weights, free to download; self-hosted.

## License
MIT — https://github.com/microsoft/SpeechT5/blob/main/LICENSE

- commercial: **yes** (Commercial use OK)
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction
  (https://github.com/microsoft/SpeechT5/blob/main/LICENSE)
- attribution: **no** (No credit needed)
  > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  (https://github.com/microsoft/SpeechT5/blob/main/LICENSE)
- in app: **yes** (Can ship inside your app)
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction
  (https://github.com/microsoft/SpeechT5/blob/main/LICENSE)

## Rules to follow
- Keep the MIT copyright and permission notice when you redistribute the model.

## How to connect
- Download only
- Repository: https://github.com/microsoft/SpeechT5
- Website: https://huggingface.co/microsoft/speecht5_tts

## Notes
Needs a separate HiFi-GAN vocoder (microsoft/speecht5_hifigan) and a speaker embedding; runs in Transformers. Hugging Face API, Oct 25, 2026: 45445 downloads, 849 likes; GitHub microsoft/SpeechT5: 1452 stars.

## Numbers (AgentGid data)
- Gid Score: 12
- GitHub stars: 1,448

## Lines to paste into your prompt or AGENTS.md

```
- SpeechT5 TTS (Voiceover (text-to-speech)). MIT-licensed English TTS fine-tuned on LibriTTS; the voice is set by a speaker x-vector embedding. Price: free; commercial use OK; no credit needed.
  Connect: download from https://huggingface.co/microsoft/speecht5_tts (no API).
  Rule: Keep the MIT copyright and permission notice when you redistribute the model.
  License: https://github.com/microsoft/SpeechT5/blob/main/LICENSE (checked 2026-10-25; details: https://agentgid.com/assets/speecht5-tts/)
```

Not verified: The license does not address commercial use of generated audio, so youtube is left empty. The Hugging Face page is a Transformers port; the original weights are linked from it (mechanicalsea/speecht5-tts).

## Links
- AgentGid page: https://agentgid.com/assets/speecht5-tts/
- Is it free for commercial use? https://agentgid.com/assets/speecht5-tts/commercial-use/
- Source: https://huggingface.co/microsoft/speecht5_tts
- Source: https://github.com/microsoft/SpeechT5/blob/main/LICENSE
- Source: https://huggingface.co/api/models/microsoft/speecht5_tts


## SpeechT5 TTS: free text-to-speech model from Microsoft

SpeechT5 TTS is a free speech model from Microsoft that turns short written text into spoken audio. It runs on your own computer through the Hugging Face Transformers library, so no account or paid service is needed. The voice comes from a voice code you choose, and you may use it in paid products under the MIT license.

### Where to use it
- Spoken messages in an app: Turn short lines like "Your order has shipped" into a sound file your app or website can play, made on your own server instead of a paid voice service.
- A different voice per character: Give each character, bot or announcement its own voice by passing a different voice code, for example in a game, a story app or a language lesson.
- Speech with no cloud service: Make spoken audio on your own machine, for example for a private tool or an offline kiosk, so the text never goes to an outside company.
- Teach it a new language or voice: Train the model further on your own recordings to get a new language or a new voice. The model page links a ready notebook for this.
- Audio for short tips and notes: Add a listen button to short help tips, flash cards or product notes, made once and stored as small audio files. (idea, not from the official pages)
- Placeholder voice for prototypes: Try out a talking assistant or a voice menu with a free voice before paying for a more natural one. (idea, not from the official pages)

### How to start
- Install the libraries the model page lists (Transformers, sentencepiece and the datasets library for the voice codes), plus PyTorch.

```
pip install --upgrade pip
pip install --upgrade transformers sentencepiece datasets[audio]
```

- Load the model, the separate HiFi-GAN vocoder and a voice code, then turn text into a 16 kHz waveform.

```
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")

inputs = processor(text="Hello, my dog is cute.", return_tensors="pt")
```

- Save the result as a WAV file at 16 kHz.

```
sf.write("speech.wav", speech.numpy(), samplerate=16000)
```


### License
MIT license, so you may use, change and sell products with it. Keep the copyright and license notice if you share the model files. The license says nothing special about the audio you make.

### Good to know
- You need two downloads plus a voice code. The speech model alone is a file of about 585 MB, and a separate vocoder turns its output into sound.
- The voice depends on the voice code you pass. The model page uses one from a public voice set, and any code of the same kind should work.
- It was trained on the LibriTTS recordings and the model page does not list languages. For another language you train it further yourself.
- The same text can sound a little different on each run, because the model adds small random changes on purpose.
- The model page was written by Hugging Face, not by the Microsoft team, and its sections on risks and limits are empty.

Checked 2026-11-19 against: https://huggingface.co/microsoft/speecht5_tts, https://huggingface.co/microsoft/speecht5_tts/raw/main/README.md, https://huggingface.co/microsoft/speecht5_tts/raw/main/config.json, https://huggingface.co/api/models/microsoft/speecht5_tts, https://huggingface.co/api/models/microsoft/speecht5_tts/tree/main, https://huggingface.co/microsoft/speecht5_hifigan/raw/main/README.md, https://huggingface.co/api/datasets/Matthijs/cmu-arctic-xvectors, https://huggingface.co/blog/speecht5, https://huggingface.co/docs/transformers/model_doc/speecht5, https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables, https://github.com/microsoft/SpeechT5/blob/main/LICENSE, https://github.com/microsoft/SpeechT5/blob/main/README.md, https://github.com/huggingface/datasets/releases/tag/4.0.0, https://pypi.org/pypi/transformers/5.23.0/json

### Mistakes to avoid
- Don't: load_dataset("Matthijs/cmu-arctic-xvectors", split="validation") exactly as on the model page → Do: load_dataset("Matthijs/cmu-arctic-xvectors", revision="refs/convert/parquet", split="validation") (The voice set still uses a loading script, and datasets 4.0 removed scripts; in our run it stopped with "Dataset scripts are no longer supported".)
- Don't: Copying the pipeline example from the model page as is → Do: Add import torch at the top (The example calls torch.tensor without importing torch, so it fails with a NameError.)
- Don't: model.generate_speech(input_ids, speaker_embeddings) and saving the result as audio → Do: Pass vocoder=vocoder (SpeechT5HifiGan from microsoft/speecht5_hifigan) to get a waveform (Without the vocoder the model returns a spectrogram, not sound.)
- Don't: Saving the waveform at 22050 or 44100 Hz → Do: sf.write(path, speech.numpy(), samplerate=16000) (The output is always 16 kHz; another rate makes the voice too fast or too slow.)
- Don't: Sending a whole article in one call → Do: Split long text into sentences, make one clip per sentence and join them (The model's text input has 600 positions (characters), so long text does not fit in one call.)

### Questions
- Can I use the generated speech in a paid app? The model is MIT licensed, which allows commercial use; the license does not add rules for the audio you make.
- How do I change the voice? Pass a different speaker embedding, a list of 512 numbers that describes a voice; the example uses voice 7306 from the CMU ARCTIC set.
- What audio format comes out? A mono waveform at 16 kHz, which you save as WAV with soundfile.
- Can it speak other languages? Not out of the box as far as the model page says; it links a notebook to train it on a new language or dataset.
- Is there an online demo? Yes, the model page links a demo on Hugging Face Spaces.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
