Method blocking GUI. Is it possible to do asynchronously somehow?

Hi guys,
I’m using a text-to-speech libray in my code.
The problem is “speak” method is blocking the GUI.
Is it possible to call it asynchronously somehow? I tried using webworkes with no sucess (It’s confusing to me)
Another solution is to use ionicLoading during processing but it not showing also.

This is the code that freezes for 5 seconds or so:
What do you guys recommend in this situation?

$scope.speak = function () {
$ionicLoading.show({
content: ‘’,
animation: ‘fade-in’,
showBackdrop: true,
maxWidth: 200,
showDelay: 0
});
meSpeak.stop();
meSpeak.speak(“Hello… Testing…”, {
amplitude: “180”,
wordgap: “0”,
pitch: “84”,
speed: “100”,
variant: “whisper”
});
}
$ionicLoading.hide();

What library are you using, we can’t help you without a lot more information.

I think he is using:
http://www.masswerk.at/mespeak/

Yes, that’s the library.