File Exchange Pick of the Week

September 12th, 2008

Making MATLAB Talk

Brett's Pick this week focuses on functionality rather than on a single file.

For a project I'm currently playing around with, I recently decided that I wanted to make my computer talk, and to use MATLAB to control it. A brief search of documentation didn't return any hits that looked promising--MATLAB doesn't really provide any mechanism for generating speech. Looking at the File Exchange (keyword "speech"), though, proved fruitful. In fact, selecting which of the several submissions to use was the most difficult part of the problem.

Chronologically, the first "speak" mfile I found was from Fahad Al Mahmood, submitted back in 2004. (Indeed, Fahad's file was selected as a Pick of the Week, back in '04.) But that file uses a call to Excel, and doesn't provide for a lot of control over the generated speech.

Fahad's submission was closely followed by Iari-Gabriel Marino's no-frills ActiveX version of TTS (text-to-speech).

Wolfgang Garn's 2006 submission includes a function called text2speech that allows a user to control pitch, to insert pauses, and to add emphasis to words.

And Siyi Deng followed up in 2007 with another version of TTS that optionally allows the user to write WAV files, to control the speed of the voice, and to list available voices.

You gotta love the File Exchange--thanks for these great submissions, Fahad, Iari-Gabriel, Wolfgang, and Siyi!

Anyone have any good stories to share about using MATLAB to speak, or doing speech recognition in MATLAB? We'd love to hear from you.


Get the MATLAB code

Published with MATLAB® 7.6

7 Responses to “Making MATLAB Talk”

  1. M replied on :

    Do you have anything that works on a Mac/Unix, that isn’t tied to the Windows SAPI ?

  2. Brett replied on :

    M, Great question. Unfortunately not, though. All of these files use (directly or indirectly) the SAPI. Up for the challenge of creating a Mac/Unix-friendly version? Anyone?
    Brett

  3. StephenLL replied on :

    On the mac, the command line has the “say” command.

    Therefore it is easy as: system(’say hello world’)

  4. Ryan Gray replied on :

    So, modifying the existing functions to support the Mac would be pretty easy by checking the computer system type. The Mac ’say’ command can also output to an AIFF file, specify the system voice name and speak the text from a file.

  5. WS replied on :

    What happened to Doug? Is he not blogging any longer?

  6. Brett replied on :

    WS,
    Doug is alive and well–and still blogging. As of today, “Doug’s Pick of the Week” officially becomes “File Exchange Pick of the Week,” hosted by Bob, Jiro, and me. Watch for the launch of an exciting new blog by Doug, focusing on…well, the stuff he likes to focus on. MATLAB, videos, contests, tutorials, ….

  7. WS replied on :

    Cool. The more blogs, the better. Keep it going!

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.