Also just to note, I'm not using Realtek audio, as my motherboard (ROG Strix x570-F Gaming) doesn't use it, and I'm still having the exact issue OP is having. Also the preview version of Minecraft BR works perfectly for me atleast.
Squonky's work around, albeit strange, works for me also, just play a YouTube video on your browser before starting Minecraft and it works fine even after closing the video after loading Minecraft
Yep still have this issue although a very specific fix works for me, playing any youtube video specifically on opera gx before starting the game seems to fix it for me then I can safely close opera gx and play like normal with sound on mc and discord etc. (running on windows 10 btw)