I got an automatic test suite for an old application that needs to be tested regularly. Both, test and the legacy application are separate processes.
Within my test I need to detect, if a specific sound file has been played by the application. I know, the application plays the sound using the PlaySound method (https://learn.microsoft.com/en-us/previous-versions/dd743680(v=vs.85)).
Using my test process (C# code) I can create situations that should make the application play the sound. But how can I implement a check within the test process, that the necessary call to the PlaySound method also happens?
Do you have any chance to somehow hook detect if the application calls this PlaySound method?
(Or will I really need to monitor the sound output and check, that it contained this file theibry? Lets hope not, but if so, whats an appropiate way to monitor and detect such audio samples?)