Hi everyone,
As of right now, I have a MATLAB app designer app that has an input screen where whoever runs the app is able to type whatever they want into it and click a button to display their text on the panel that becomes visible (covers the input box). Is there a way to code in that the computer will speak the text they type into the input box when the "enter" button is pressed? I found this code (not mine) online and am thinking there is a way to add parts of this to my code and make the audio work.
userPrompt = 'What do you want to say to the patient?';
titleBar = 'Text to Speech';
defaultString = 'Type in a message you want the patient to hear!';
caUserInput = inputdlg(userPrompt, titleBar, 1, {defaultString});
if isempty(caUserInput)
return;
end
caUserInput = char(caUserInput);
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, caUserInput);
Thanks in advance!