Running heavy processing with Asterisk

Hi, I am running Asterisk to create a server in which one can record one’s voice. I need to do some heavy processing on this recorded file and play it back to the user. However, while the processing is going on, I want that the user should listen to some music file and the processing should continue in the background. Once the processing is done, I will playback the processed file. How can this be done?

Can you post your dialplan and how you do the processing (you don’t have to pose your secret code :wink: ).

Best way is if you create own application, which will send frames to user and will check after each frame if processing is finished. This way you could be sure user will wait no more then 1 more frame, which is 20 ms long.
Other way is to get music in small parts - lets say 1 sec each and play piece by piece checking if processing finished. This way user will wait one more sec max.

I am also looking for something similar. any solution to this?