There are only two ways to get digital audio between your TV and soundbar, or your TV and receiver, or really between any piece of gear that transmits audio in a home A/V system: HDMI and optical.
It was once the most high-tech and futuristic feature you could find: Transmit sound -- with light! Lasers! A cable not of copper, but glass! Except, it was almost never glass, and was usually ...