I am using a raspberry pi 4 and am having issues with the sound output. I am trying to run a program in python using pygame to play an audio file when I run the program. The program works and it plays whatever audio file I want to play, the issue is that it plays out of the speakers of my TV (which I'm using as a monitor) instead of the speakers that I have plugged into the audio jack of the raspberry pi. However, when I double-click on the audio file it plays out the correct speaker. So the issue is with the python program. Is there a solution to this? I won't be using a monitor when I finish this project so I need the audio to come out of the speakers that are in the audio jack.
Update: I didn't realize my speaker output was set to HDMI instead of the audio jack, I was sure I changed it earlier. Anyway, the issue is fixed!