Optical cable
The optical cable in home audio systems is used exclusively for transmitting high-resolution multi-channel audio. Thanks to this, it can be used to connect powerful stereo systems.
Also, the optical cable supports audio transmission with Digital Theater Systems (DTS) or Dolby Audio surround playback technology. They are perfectly compatible with multichannel audio systems (types 2.1, 5.1 and 7.1), and also provide realistic playback with the correct construction of the scene. DTS and Dolby Audio perform best when watching movies and listening to music.
HDMI cable
HDMI is a universal multimedia interface. This interface is used to transmit both video, and audio, and audio signals simultaneously.
It is through the HDMI interface that in most cases high-resolution playback devices are connected to the TV – digital television receivers, game consoles, home theaters, and much more. One wire is used for both video and sound.
The main advantage of HDMI is that it supports truly multi-channel sound. For example, the generation 2.0 interface introduced in 2013 supports up to 32 channels of audio! Of course, surround sound technologies like DTS or Dolby are also implemented. But the 32-channel sound signal is presented only in generation 2.0 and newer. But owners with equipment equipped with 1.4 generation will have to be content with 8-channel (7.1 audio systems).
The difference between HDMI and optical
HDMI and optical are connection ways that can transmit high-quality sound from one device to another. There are significant differences between the two, although you should consider before choosing one or the other.
An optical cable was designed to transmit sound only when HDMI was designed to play high-quality video, multiple audio streams, and even the CEC channel. For this reason, if you need to connect only for audio, then choose an optical cable. But if you need to transfer more than audio, you might be better off with HDMI.
Even if you are only going to use a cable for audio transmission, there is still a reason to prefer HDMI over an optical connection. Optical does not support Dolby Digital Plus, TrueHD, and DTS HD formats supported by HDMI.