Does the cable box have an optical output? If yes, you can run that straight to your receiver. You may have to change settings in the cable box to output audio to optical.
If that is not an option, my next question is if the TV itself will output audio the way you have it set up now. If no, you probably need to change a setting in your cable box to output audio to hdmi. If yes, you may need to change a setting in your TV to output audio to optical.
If none of that is the answer, you might want to try something besides the optical. Any other outputs on the TV? Any other inputs on the receiver? If you can get the sound to the receiver with any kind of cable, it’s going to sound fine and be much better than the TV speakers.
Good luck!