Listening to music is not illegal and especially when you are cycling or driving. Although it is not unlawful, it is not safe to block your ears with AirPods or earbuds. You should be aware of the traffic to prevent any possible accident occurrence. Therefore, the best choice for cyclists is the bone conduction headphones.