In Ubuntu, to get the sound in Musescore 4, after installing Pipewire (with its repo) you could have to follow these steps (in Italian, but you can find it in English as well).
If you have, following that steps, an error (such as Error while installing package: trying to overwrite '/usr/share/man/man1/pipewire-pulse.1.gz', which is also in package pipewire-pulse 0.3.48-1ubuntu3
) you can resolve with this command:
sudo dpkg -r pipewire-pulse
As said here.