title: Detecting Windows System sounds with Python
body: <p>I have a python script that pulls the cell values from a spreadsheet and inputs it into a program. Problem is that if there is an error that occurs when the information is being input (duplicate value, navigational error, sql error, etc) the script will not recognize that there is an error and just keep running. I'd like to find a way to have the script recognize when these errors occur and hold the script or take another action.</p>
  
  <p>All of the errors vary between each other, but all of them produce a prompt window specifying the error code, the description, and they it plays the default "Windows Background.wav" sound in C:\Windows\media when it. The only thing that remains consistent through all possible errors is that sound so I thought I could have Python store that sound as a variable and constantly check to see if it has been triggered.</p>
  
  <p>I saw modules like pyaudio, audioread, and winsound, but none of them seemed to have any way to read the wav file, store it as a variable, and then monitor the output of the system sounds on the volume mixer to check for it. Hoping there is a solution for this or possibly another way of going about checking for any errors that might occur with the program the script interacts with.</p>