Asynch operation exception

Status
Not open for further replies.

SWSDEV

Forum User
Joined
Feb 23, 2008
Messages
256
Reaction score
0
I am getting this exception when trying to start an external code component.

This error is from the asp .net page having an issue and not the code component. But they could be linked I'm sure, have you guys run into this before?

Exception has been thrown by the target of an invocation. --> Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
 
Hi,

I never saw this behavior. What is the DLL doing? Are you launching some task in backgrund?

Thanks,
 
I am using the Speech API classes.

SpeechSynthesizer speaker = new SpeechSynthesizer();

Although I'm not 100% sure that is the cause, but that's the difference between everything else we've done.
 
Maybe that class triggers som task in background, not sure, I never used it.

Are you planning to generate TTS with that API? And stream it using the VAD? Maybe an option could be generate it in a separated process, and use an External Code Execution Component to communicate with it.
 
Yes I am using TTS. Using the code component to talk to the Microsoft library.

I'd like to avoid threading, because then when the VAD gets to the playback step there's no guarantee that the audio file will be ready for playback.
 
Upon debugging the IIS worker process, the exact function it throws the exception on is

speaker.SetOutputToWaveFile(filename);

I tried setting Async="true" on the asp .net file, but that didn't help.
 
Something you may try is creating a separated process or web service to do the TTS task. Then you can connect with it using an External Code Execution or Web Services Interaction component, and wait there until the task is completed. That way the async operation will be out of the IIS process, and you should not have this problem.
 
Status
Not open for further replies.