There are a lot of options for listening to music while wearing helmet you can use a pair of true wireless earbuds, a portable Bluetooth speaker, or a set of bluetooth motorcycle intercom systems & headsets. Actually there is a niche product specifically for helmet - Bluetooth helmet speaker, they are a pair of speaker attached to a cable (pretty much like the wired Bluetooth earbuds you got to see back to the old days before the advent of true wireless earbuds). It can be a intercom system (Sena and Cardo are two main brands), or a pair of TWS speakers or a pair of Bluetooth speakers with cable attaced to. All these are capable of pairing with your phones, however, the intercom system has a lot more features (such as the group intercom features and mesh connections) if you ride in a large group.
Wearing just helmet is quite boring - let it be more alive with Bluetooth helmet speaker.
I'm currently reviewing the others that I will add to this post soon.
Note: this guide doesn't cover built-in speaker helmet. Standalone wired and wireless helmet speakers are more flexible and sound better than built-in speakers helmet.