Why listen to music if you can listen to the sound of waves and wind? Nah... just kidding, sailors love music and all modern yachts are equipped with quite a nice sound system.
All yachts have two sets of speakers, one set of waterproof speakers are installed in the cockpit and another inside the main salon. It’s possible to configure them in a way that only one set of speakers is playing music when another pair is silent. It is very useful when someone wants to sleep in the cabin below the deck and crew in the cockpit wants to have some fun. Another example is a quiet evening in the marina when you want to listen to music inside the boat but do not want to bother your neighbors with loud music.
The media receiver installed on board is the same as used in cars and is able to play music from the radio, CD, AUX and USB. The most reliable way to be sure you can enjoy your favorite tracks is to upload them to your phone and bring a 3.5 mm AUX cable. And of course, a portable speaker is the best for mobility, you can always bring one with you to the beach.