text to speech?

I know OSX has all this text-to-speech junk built in, but is there some simple way to take a text file and convert it to an audio file (WAV, AIFF, MP3, anything)?

Update: "say -f foo.txt -o foo.aiff". How about that!

Tags: , , ,

30 Responses:

  1. cvisors says:

    there is a command called say, which you can pipe stuff into, say -o foo.aiff will write the output to a file.

    -b

    • jwz says:

      Thank you. Thank you for actually answering the question, and thank you for not being like all these other cock-knockers below.

      • strspn says:

        Comparison of question-answer fora:

        Ask Slashdot Google Answers USENET jwz lazyweb
        accuracy: fair good both depend on phase of moon
        SNR: low high rock-bottom never good enough
        advantages: fairly quick semi-professional worldwide guru coverage highly entertaining
        disadvantages: troll infestation pay to play infinite spam topics limited to current jwz frustration (could easily be more limited)
        beware of: GNAA differences over what constitutes an answer Nigerians swift wrath
        failure mode: if answer not evident in first hour, only posts mocking question get modded up; must read all posts, Newest First, to get real answers money squables cascades from regulars flaming off-topic kernel recompilation or switch-back-to-linux imperatives
        what you will learn: far more detail than you wanted to know how easily you could have found what you just paid $20 for if you had spent another few minutes looking that your question is either in the FAQ or a thread from last week multicultural sexuality, technogoth DJ tips, and how to run a nightclub
        what you won't learn: whether the answer works without overclocking, a RC UAV case mod, and stolen winmodem driver source how the geek who answered your $50 question in ten minutes found it the canonical reference found in most libraries instead of the same answer in an obscure 1978 Ph.D. thesis patience
        worthwhile for: often the top world expert provides the answer tireless dedication of tens of thousands of food-stamp recipients working from their parents' basement tenured subject experts still reading with trn on 24x80 Zenith-19s (because office clutter doesn't allow terminal upgrades) not distracted by web porn angst-charged luser plonkings
        respondents' motivations: damn editor bitchslapped dupe complaints last week, excellent karma status at risk making an easy buck nemisis on other continent might upstage by providing quicker answer one word: fanboys
        question poster's motivation: don't know how to use Google don't know how to use Ask Slashdot too poor to use Google Answers computers hate jwz
        50 years from now: OSDN purchased by TimeDisneyOL; text no longer permitted on /. Google purchased by Microsoft; only certified copies of IE for Win2055 Pro allowed to post questions USENET posts classified as "indymedia copyrestriction crime" -- only graft by spam harvesters allows it to continue General advice on cleaning up messy spills to giant teledildonic service robot manequins
        • duskwuff says:

          Your table is seriously breaking the layout. At least, I think I'm responding to <lj user=strspn>'s comment, which is currently below my comment box. I think you mislaid a row somewhere.

          • strspn says:

            Sorry, I don't know why it did that. The HTML is perfect except for a missing slash before the final td tag. Still, that's perfectly legal and it shouldn't be messing everything else up.

    • Holy crap!

      lazyweb works?!?

      I may have to re-examine my whole outlook on life...

    • edlang says:

      I know how much you hate teh lunix, but as I don't have a Magical Mac could you please, if you've some idle time, upload samples of piping the text through the chef / B1FF / etc filters before they go through /usr/bin/say?

  2. the_p0pe says:

    I find it incredibly hard to believe that you haven't heard of festival before. It's a bit bloaty, but kinda neat. The suggestion to use "say" is better though.

    • nugget says:

      Not wanting to use festival can be the result of not knowing about it...

      Or just as likely, not wanting to use festival can be the result of knowing about it.

      I think you presume too much. Festival isn't much easier than writing a Linux driver to control a Speak n' Spell, with similar quality results.

      • the_p0pe says:

        Or just as likely, not wanting to use festival can be the result of knowing about it.

        Bingo

      • violentbloom says:

        all the good voices are on windows :( which sucks on a number of levels.

        • spike says:

          There are some great (commercial, $30ea) voices for Mac OS X's native text-to-speech synth available from Cepstral. If you're even a moderate user of TTS, they can be a fun addition to the standard set. And if anyone else hears your TTS audio, using one of the Cepstral voices sets it apart from the usual choices.

          Now about getting those National Weather Service voices...

          • curious_au says:

            Thirty dollars? I can get one of my students to sit under the desk and read it off an LCD for that price!

            • err0neous says:

              WTF is wrong with you people?? The first god damn post answered the question concisely and correctly. I don't understand why you all feel the need to continue to go on about garbage like festival (you morons think that compiling some software is somehow easier than 'say?') and other shit that you have to pay for!

              I suppose you are all probably just doing it on purpose to piss off jwz.

              • fantasygoat says:

                Hmm, now that you mention it.

              • spike says:

                Um, the Cepstral voices work with the built-in Mac OS X text-to-speech engine. They are plug-ins for it. They extend it. They make it work better. In this case the "shit" that you "have to pay for" is completely optional.

            • spike says:

              Thirty dollars? I can get one of my students to sit under the desk and read it off an LCD for that price!

              If I'm going to pay someone $30 to get under my desk, "reading text off an LCD" might not be the first thing I'd want them to do, but maybe that's just me.

              I wonder if there's a "talking with your mouth full" voice module out there somewhere?

              • ziggy_san says:

                If I'm going to pay someone $30 to get under my desk, "reading text off an LCD" might not be the first thing I'd want them to do, but maybe that's just me.

                I wonder if there's a "talking with your mouth full" voice module out there somewhere?

                I laughed. Giggled, even.

    • jwz says:

      You're a dumbass.

    • ziggy_san says:

      Dude, holy crap...

      Either I'm a retard when it comes to computers, or that festival program is really freakin' hard to install. Compiling? C++? ARGH! Plus, there's like 23 different files to download and I have no clue which ones I need!

      Yeah, I guess I could Google for that C++ compiler thing but...isn't there anything out there that's a tad easier to install?

  3. toucansam616 says:

    who are you?

    i searched for crack monkey on google and found this

  4. jerub says:

    automator makes it easy. you can set up automator to allow you to drag a text file onto a workflow that will create an audio file. You even get a choice of what voice to use.

    Assuming you have 10.4 of course.

  5. airmax says:

    Once upon a veery long time ago there was such nifty tool for DOS. But that looks more like one of useless facts I have.