|
|
| say(myString,voiceName)
|
function say(myString,voiceName)
a = actxserver('SAPI.SpVoice.1');
if nargin > 1
% Valid voice names are 'LH Michael', 'LH Michelle'.
% You may be able to get more somehow.
voicestr = ['Name=',voiceName];
else
voicestr = 'Name=LH Michael';
end
a.Voice = a.GetVoices(voicestr).Item(0);
a.Speak(myString);
a.delete
|
|
Contact us at files@mathworks.com