0

I have been writing my own speech recognition program in C# using Microsoft's speech engine for a couple of weeks now and I have used the iTunes Library .dll file to control iTunes. The problem I have with this though is, if the recognition engine misinterprets 'Close' as 'Pause' and iTunes isn't open, the program crashes. I want to know how or if it would be possible to write an if statement that will only execute if iTunes is open. If I need to be more specific, let me know and I will update the question.

  • Sounds like you mean to ask "how do I check if a program is running" and in which case, I would point you in this direction http://stackoverflow.com/questions/1742787/check-if-a-specific-exe-file-is-running – User 12345678 Aug 02 '14 at 13:55

1 Answers1

0

Use the Process.GetProcessByName function:

var isRunning = Process.GetProcessByName("iTunes").Any();
Lucas Trzesniewski
  • 50,214
  • 11
  • 107
  • 158