I need to write program that will be given some path as a parameter, and play audiofile, located in that path. But after i call that program second time-i need first one to finish playing file and after that-play second file, that was passed as a parameter to second instance. How to pass second parameter as queue to first program instance if its possible..?
Share
I guess you’re describing the following strategy:-
Evidently this is the way VLC media player works. If you try the above, you will see a new VLC process appear for a short time before your current instance starts playing the new track.
This kind of very simple cross process communication can be achieved using something like System.Threading.Mutex. E.g. you could use one mutex to indicate the existence of a currently running instance and another for passing the new track name to the current instance.
In fact, this article describes something quite similar.