Python Forum
Detecting Windows System Sounds?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting Windows System Sounds?
#1
I've written a script that uses pyautogui to interact with another program on my computer, but I'd like to build in some failsafes into it to deal with errors that may pop up should they occur. The error messages that may come up all vary between each other and the only thing that remains consistent is that the "C:\Windows\media\Windows Background.wav" file is played when an error does happen. So I'm hoping to write into the script something that either detects when the wav file is accessed/ used by another program, or detect the output from the speakers to know when the error sound is played. Pyaudio and audioread seemed close to what I need, but neither seemed to have a way to store the sound, detect it, and trigger an event when it does occur.
Reply
#2
for Pyaudio, see: https://stackoverflow.com/questions/1765...-in-python

If that doesn't work, Perhaps try another wav package?
see: https://pypi.python.org/pypi?%3Aaction=s...mit=search
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with playing sounds jderickson 5 1,280 May-25-2023, 09:52 PM
Last Post: jderickson
  iterating and detecting the last Skaperen 3 1,085 Oct-01-2022, 05:23 AM
Last Post: Gribouillis
  Detecting float or int in a string Clunk_Head 15 4,573 May-26-2022, 11:39 PM
Last Post: Pedroski55
  module detecting if imported vs not Skaperen 1 1,680 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  detecting a generstor passed to a funtion Skaperen 9 3,621 Sep-23-2021, 01:29 AM
Last Post: Skaperen
  Python BLE Scanner not detecting device alexanderDennisEnviro500 0 2,013 Aug-01-2021, 02:29 AM
Last Post: alexanderDennisEnviro500
  How to link Sublime Text 3 Build system to Python 3.9 Using Windows 10 Fanman001 2 4,616 Mar-04-2021, 03:09 PM
Last Post: martpogs
  Difference between os.system("clear") and os.system("cls") chmsrohit 7 16,651 Jan-11-2021, 06:30 PM
Last Post: ykumar34
  Detecting power plug Narayan 2 2,726 Aug-01-2020, 04:29 AM
Last Post: bowlofred
  Detecting USB Device Insertion on Windows 10 Atalanttore 0 2,393 Jan-17-2020, 02:46 PM
Last Post: Atalanttore

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020