I've reproduced this issue when userPrompt has two strings, e.g.) text area contains line breaks.
You might add join command to combine multiple lines into one string array.
userPrompt = app.whatdoyouwanttosayTextArea.Value;
userPrompt = string(userPrompt);
userPrompt = join(userPrompt);
speak = System.Speech.Synthesis.SpeechSynthesizer;
Are you using another .NET or Java library which also uses Speak function?
How about the following?