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.

  • Jon: This is a useful tool - but in fairness I have to point out that it is remarkably similar to a routine of the...
  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?

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