1) In the main() or anywhere else, you schedule your thread function.
CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE,ThreadFunction, &dummy,NULL);
As long as you use the default values, you don't have to care about closing the treads, waiting for completion, etc...
2) Your thread function (running in a separate thread) calls Audiooutput().
int ThreadFunction(void *functionData)
{
...
CA_InitActiveXThreadStyleForCurrentThread(0,COINIT_APARTMENTTHREADED); //may be useful in some cases
...
Audiooutput()
return(0);
}
Regards,