InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac Command Line tutorials

  • Bulk convert jpeg files to png using sips on mac
  • Custom terminal tab title and ssh on mac
  • How to convert text to speech on Mac using command line utility say
  • How to join multiple pdf files on Mac
  • How to use qpdf to add/remove password from pdf on mac
  • Install redis on Mac
  • Mac - find which process is listening on a port
  • Mac - hide and unhide a file or directory
  • Mac - open a terminal from a folder
  • Mac - print java home on command line
  • Mac - search files on command line using mdfind
  • Mac command line convert svg to png
  • Mac command line utility open - some handy tips for better productivity
  • Mac terminal - how to close shell on exit
  • mac pkgutil - quick start guide
 
  • Home
  • > Tutorials
  • > Mac
  • > Mac Command Line

How to convert text to speech on Mac using command line utility say

By admin | Last updated on Jan 27, 2016

Mac lets you convert text to speech using command line utility “say”. It also lets to generate an audio file in various formats and voices. This is pretty handy to generate audio file given the text. Here are couple of ways to use it:

  1. Use say to pronounce “Hello world” with default voice:
    say "Hello world"
  2. Using say with a pause after Hello:
    say "Hello, world"

    In case you need bigger pause repeat comma e.g.

    say "Hello,, world"
  3. Using say with voice Alex:
    say -v Alex "Hello world"
  4. Using say with voice Alex and output audio to a file (default format aiff):
    say -v Alex "Hello World" -o out.aiff

Sample output for some voices

Here is sample output for text “Using Text to Speech (TTS), you can have Alex and other Mac voices speak selected text so you can hear a word as you see it onscreen.” using various voices:

  1. Using voice Alex (Male Voice):
    say -v Alex "Using Text to Speech (TTS), you can have Alex and other Mac voices speak selected text so you can hear a word as you see it onscreen." -o mac-text-to-speech-tts-demo-alex.aiff

    Outcome: mac-text-to-speech-tts-demo-alex.aiff

  2. Using voice Bruce (Male Voice):
    say -v Alex "Using Text to Speech (TTS), you can have Alex and other Mac voices speak selected text so you can hear a word as you see it onscreen." -o mac-text-to-speech-tts-demo-alex.aiff

    Outcome: mac-text-to-speech-tts-demo-bruce.aiff

  3. Using voice Victoria (Female Voice):
    say -v Alex "Using Text to Speech (TTS), you can have Alex and other Mac voices speak selected text so you can hear a word as you see it onscreen." -o mac-text-to-speech-tts-demo-alex.aiff

    Outcome: mac-text-to-speech-tts-demo-victoria.aiff

Voices available on your system

Voice Alex is one of the most popular voices and you can use it if you don’t want to spend too much time on trying other voices. To see the list of voices available on your system run say -v ?. There are couple of other voices which can be downloaded from Apple’s web site. Here is the default list on Mac OS X 10.7.5 at the time of writing this article.

Agnes
Albert
Alex
Bad News
Bahh
Bells
Boing
Bruce
Bubbles
Cellos
Deranged
Fred
Good News
Hysterical
Junior
Kathy
Pipe Organ
Princess
Ralph
Trinoids
Vicki
Victoria
Whisper

Output formats

The default output format is aiff. To change the output file format, just change the output file extension. To see the list of output file format available run say --file-format=?. Here is the outcome on Max OS X 10.7.5

3gp2 3GPP-2 Audio (.3g2) [Qclp,aac,aace,aach,aacl,aacp]
3gpp 3GP Audio (.3gp) [Qclp,aac,aace,aach,aacl,aacp]
AIFC AIFC (.aifc,.aiff,.aif) [lpcm,ulaw,alaw,ima4,Qclp]
AIFF AIFF (.aiff,.aif) [lpcm]
NeXT NeXT/Sun (.snd,.au) [lpcm,ulaw]
Sd2f Sound Designer II (.sd2) [lpcm]
WAVE WAVE (.wav) [lpcm,ulaw,alaw]
adts AAC ADTS (.aac,.adts) [aac,aach,aacp]
caff CAF (.caf) [Qclp,aac,aace,aach,aacl,aacp,alac,alaw,ilbc,ima4,lpcm,ulaw]
m4af Apple MPEG-4 Audio (.m4a,.m4r) [aac,aace,aach,aacl,aacp,alac]
mp4f MPEG-4 Audio (.mp4) [aac,aace,aach,aacl,aacp]

e.g. To generate a wave format output file run say "Hello World" -o out.wave

Suggested posts:

  1. AWS EBS and reliability/durability
  2. PhantomJS – find all fonts-families on a web page
  3. Mac brew – how to relink installed binaries for a package
  4. Find used ports by an app on Android using Adb
  5. HTML5 – video tag
  6. AngularJS hello world example
  7. CSS all – shorthand to reset all properties
  8. Convert mp3 to ogg on Mac using ffmpeg
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress