I am trying to use ScreenCaptureKit to select this window automatically rather than having the user do it.
This is just something I'm noticing, but it appears Chrome will append a sound icon to the title of its window when it makes sound
Sure. Safari does something similar and I'm sure other apps do as well. The issue here is the difference between what an app "knows" about it's on activity and what the system "knows". Taking a web browser as an example, "generating audio" is basically just another data rendering task (download data, process data, "render" data into final form) that's not all that different than any other kinds of data it process. The final output is something you hear instead of seeing, but the broad mechanics are the same.
A web browser "knows" that audio is associated with a particular view/window because that's an associate it was "already" managing as part of the broader task of tying "all" of it's activity to a particular source. In that context, appending the sounds icon is a simple interface choice just like displaying the favicon is.
The system's view of this process is totally different. All it really "sees" is the connection(s) a process creates "into" it and the memory buffers passed into it over that connection. None of that activity is has any connection to the window system because that connection simply does not exist and never has as the system simply does not work that way.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware