Sonos sound bars can be
trained to respond to arbitrary Volume Up/Down/Mute IR commands. There is also an “Autoplay” function that will automatically switch play the input when the signal starts. Typically this works well, switching to TV audio as the TV is turned ON.
Newer bars will respond to CEC commands. Usually, CEC setup is automatic and the bar responds to TV Volume commands, however they arrive at the TV. In many cases the Bars can send numeric Volume confirmation back to the TV for display.