This solution worked for me: After the sound stops working open the Realtek Audio Console (just do a search for it from the task bar). Under Default Format make a note of the current sample rate selection. Change it to something else and then change it back again. Sound comes back.
same issue. Cannot log in to my Realm via Windows 11