Mendix has a tutorial how to perform text to speech using javascript actions.
https://docs.mendix.com/howto/extensibility/write-javascript-actions
Note that javascript actions are currently in beta.
But apparently there are also appstore modules which do the trick.
though there’s no appstore widget for this (as far as i know)
There are multiple API’s you could call for this. Watson has an API for speech to text: https://www.ibm.com/watson/services/speech-to-text/
as well as google: https://cloud.google.com/speech-to-text
Edit:
actually there’s an item in the appstore added last month by Tim van Steenbergen