Problem, audio Raspberry pi 4B

Hi,
I developed a small game under Java with Linux 64bit official Raspberry pi distribution (GNU /Debian bookworm). The problem is that I don’t know how to direct the audio to the HDMI, my audio always comes out to the Jack socket (this doesn’t suit me). Of course, I enabled the HDMI output in the mixer, but the audio still goes through the jack. I tried to deactivate the jack at the hardware level (via /boot/config), so I have the audio coming out through the HDMI, but the sound is very choppy and delayed, even from aplay, the audio has a delay of one to two seconds on the speakers. An idea ? THANKS

This isn’t a general raspberry pi support forum. We only usually help with ZynthianOS. If you’re using Raspberry Pi OS then maybe try using the raspi-config tool

Raspberry Pi OS questions are probably more suited to https://forums.raspberrypi.com