I personally don't feel comfortable wearing earphones when I'm riding.
My suggestion is that if it is illegal and you are in an accident the insurance company may not be willing to cover or it could be considered as your fault. It may be a good idea to check with the police and/or your insurance and see what they have to say. I would call as an anonymous caller or have a friend do it.
Thanks, Jack aka:makeitso