MATLAB TEXT TO SPEAK PROJECT

%YAWOT.COM.
% TEXT TO SPEAK CODE TEST OK WITH MATLAB 2011B.
% Program to do text to speech.
% Get user's sentence
userPrompt = 'What do you want the computer to say?';
titleBar = 'Text to Speech';
defaultString = 'Hello World!  MATLAB is an awesome program!';
caUserInput = inputdlg(userPrompt, titleBar, 10, {defaultString});
if isempty(caUserInput)
  return;
end; % Bail out if they clicked Cancel.
caUserInput = char(caUserInput); % Convert from cell to string.
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, caUserInput);

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with us on social media and stay update with latest technology/ projects !

Flag Counter