Apple - How to know which program has just played sound?
Sounds like the iMessage logged in notification.
Try this command in terminal to verify:
afplay "/Applications/Messages.app/Contents/Resources/Logged In.aiff"
To turn if off you can turn off "Play sound effects" in the iMessage preferences.
SoundBunny might be able to help with this. The primary purpose of the app is to let you control various apps' sound levels, but it also usually shows you what apps have recently made sounds, which might help.
You can download a free demo from their website and leave it running until you hear the noise again, then switch over to SoundBunny and see what it shows.
While it's not possible to check that directly, here are some workarounds:
- If you're using Google Chrome (or similar web-browser), look for speaker icon next to tab or window (e.g. check in Window menu).
- If you're using Safari, you should see also speaker icon next to the tab which is playing.
- Some apps such as SoundFlower can provide extra kernel extension for pass-through audio, so then they can check which processes are accessing sound device.
- Double check Notifications in System Preferences, and either set Do Not Disturb or disable Play sound for notifications for the recent or all apps. See this post.
Check for log entries, e.g. by the following command:
log stream --level=debug
Check for any file activity by
fs_usage
command, e.g.sudo fs_usage
Using trial and error, pause and resume processes to find out about the process, e.g.
ps d kill -STOP 1234 5678 # Stop processes via PID(s). kill -CONT 1234 5678 # Resume selected processes.