Is there a simple way to run a file when a different file is run?

Is there a simple way to run a file when a different file is run?

I'm trying to add some effects using an arduino uno that run each time a .ogg sound file is played. I have windows 7 Professional 64-bit if that info is usefull...

Can you please clarify what you mean?

I need to have a serial message sent to an arduino every time a file is run.
Not sure how to explain it more.

what you mean with "a file is run",
what is that file? is it an MP3, video, or an Arduino application aka sketch ?

It is an .0gg sound file

It is an .0gg sound file

0gg sound files do not play themselves. Some application is responsible for that. If that application can also write to the Serial port, then it can tell the Arduino that the file being played changed/is/whatever.

I realize that. Also the application cannot do anything more than tell the .Ogg file to play.

You can connect a microphone to the Arduino and recognize the transition from silence to non-silence.
That could also trigger something, but it would not be able to recognize silent pauses in a song...

I've been thinking about this for a week now and think I have an idea.

What If I split the audio output, into two identical lines. One line goes directly to the (powered) speakers and sub woofer, the other to a infrared Led. I would then edit the beginning of each .ogg file to have a very short 38kHz square wave. Each .ogg file would have a unique pattern for an arduino with one of these to detect and decode. Based on which pattern it decodes, it would do the desired effect.

What are your thoughts?

what is the name of the application you use to start the ogg files?

Umm... Minecraft.... >_>

And minecraft is played in a browser, right?

Not sure. I play it by clicking the .exe & can play it without a internet connection.

What you could do is to monitor the process table of the PC - Sysinternals - Windows Sysinternals | Microsoft Docs -
and search for your exe and the associated files.
The OGG file played should be one of the open files, so if that changes you could send a command to Arduino.

Far from trivial but here is a starting point - Listing Used Files - CodeProject -