Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8271619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:53:46+00:00 2026-06-08T06:53:46+00:00

In terminal on OS X, if you type say and hit return the command

  • 0

In terminal on OS X, if you type “say” and hit return the command doesn’t exit and any subsequent things typed in (followed by return) are said by the system. How can this kind of effect be achieved?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:53:47+00:00Added an answer on June 8, 2026 at 6:53 am

    If you type cat and hit return, the command doesn’t exit and any subsequent things typed in, followed by a return, are printed on the screen (instead of being converted to speech through the speakers, as with say). So, the easy bit is reading lines until EOF; you can use fgets() for that, easily enough, or getline().

    int main(void)
    {
        char buffer[4096];
        while (fgets(buffer, sizeof(buffer), stdin) != 0)
        {
            fputs(buffer, stdout);
            // Or invoke appropriate text-to-speech function(s)
        }
        return(0);
    }
    

    The text-to-speech conversion will be done through calls provided by Apple. You may need to use Objective C to get at the interfaces sensibly, in which case you may also need to use some other input function or convert the string into an appropriate Objective C construct.

    The /usr/bin/say command uses the libraries:

    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 633.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
    

    The combination of AudioToolBox, AudioUnit and CoreAudio will provide the text-to-speech services.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can type in the following code in the terminal, and it works: for
I have terminal.app set to accept utf-8 and in bash I can type unicode
Suppose my terminal screen is 40 lines high. Suppose I type in clear; Suppose
The TextMate2 (Alpha 9090) terminal support does not install anything in any directory. Is
What is the terminal command, or where is a good resource to get them,
From a terminal window: When I use the rm command it can only remove
Step 1: I open a terminal and type mkfifo mypipe cat < mypipe Step
mohpc04pp1: /h/u544835 % psql arco Welcome to psql 8.1.17, the PostgreSQL interactive terminal. Type:
I have a simple command in a Linux shell script (say foo.sh). In it
If I type into a terminal, export DISPLAY=:0.0 ... where is the shell storing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.