Background task for simple operations?

129 Views Asked by At

I need to play several sounds, and if one sound is already playing, the subsequent sounds will be queued. I'm using MCI API calls.

Until now, I'm using this sound player as a COM control with InterOp.

However, the COM control causes some COM Release errors, so I would like to solve it differently.

I would like to know if I should solve this by a usual NET class in my form using a background task so that I'm completely indepenent on how heavy the load of my application is so that finished sounds can immediately trigger playing the next sound without any delay, or if that would be an overkill, and background tasks should only be used on long, blocking operations.

My sound player basically only uses a timer to check with an API call if the MCI has stopped playing and then starts the next sound.

Also, it provides events when a sound was started, stopped or errored-out.

Or if I should encapsulate the player in a separate NET project and reference it? Then I would also be independent on the workload of the main application.

Seamless playing of the sound queue would be essential to me.

0

There are 0 best solutions below