Text to baa.
Type anything. Pick a lamb. Get back the sound of sheep, as long as your text takes to read aloud. In every language, with no exceptions and no words.
As long as reading it aloud
People read aloud at about 150 words a minute. Words are a poor unit across languages (Finnish fits a sentence into one word), so we count letters and digits instead: 150 words of about five letters each is 12.5 letters a second. Spaces and punctuation are free. Anything you type gets at least one second of sheep.
Then we pick baas at random, play each a little higher or lower depending on the voice, leave a pause after each, and pad the end with silence so the file lasts exactly the estimated time, to within 26 milliseconds.
One endpoint, familiar shape
If you have used a text-to-speech API, you already know this one. Any xi-api-key works; baa-demo-key is traditional.
curl -X POST "https://YOUR-HOST/v1/text-to-speech/dolly" \
-H "xi-api-key: baa-demo-key" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world", "model_id": "baa_multilingual_v1"}' \
--output baa.mp3
- Path:
POST /v1/text-to-speech/{voice_id}. Optional queryoutput_format: anymp3_value is accepted; you get 44.1 kHz mono MP3 at 64 kbps whatever you ask for. - Body:
text(required, up to 5000 characters),model_id(baa_multilingual_v1orbaa_flash_v1),seed(integer, same seed, same baas). Other fields are politely ignored. - Answer:
audio/mpeg, with headerscharacter-cost,request-id,x-baa-estimated-secondsandx-baa-duration-seconds. - Errors: JSON with a
detail: 401invalid_api_keywhen the header is missing, 404voice_not_found, 422 for blank or overlong text, an unknown model, or a format that is not MP3.
Voices
dollyDolly. Warm, classic ewe. The default.lambertLambert. A young lamb. High, earnest, a little breathless.ewenEwen. A ram with a baritone. Audiobooks and late night radio.baarbaraBaarbara. Newsreader. Crisp and slightly above it all.garyGary. A human who bleats. Method actor, no sheep involved.
Free sheep
Every baa is cut from recordings on Wikimedia Commons that are in the public domain or dedicated to it under CC0. No attribution is required; we give it anyway.
- Sheep_bleat.ogg by Eviatar Bach. CC0 1.0.
- Sheep_bleating.ogg by earthcalling. Public domain (PDSounds).
- Corner_of_a_sheep_field_in_summer.ogg by earthcalling. Public domain (PDSounds 341).
- Man_bleats_like_goat_or.ogg by stilgar. Public domain (PDSounds).