To get better sound out of the TV, I have it connected to my stereo system. The only annoying thing was that I needed two remotes, one for the TV and one for the stereo.
I then built a little thing around an ESP8266, an IR receiver diode and an IR transmitter diode. All it does is that it listens for commands from the TV remote, and then send out different commands, but now that the stereo understands. So I only need the TV remote to control both the TV and the stereo.
For example, when I turn on the TV, the ESP8266 sees that the on command is sent to the TV, and then sends out the on command to the stereo too.
I started out using the IR receiver diode to look at what my remotes actually send out when you press the buttons. That was a bit fun, to see what codes that are really sent.
Then it was just a matter of listening to the right codes for the TV, and outputting the ones for the stereo. All was made so much easier because there were libraries for both receiving and transmitting IR data.