There's a number of variables involved with the problem you've stated, could be a problem with those new earbuds, or with the headphone jack in your phone, or even just the remote chance it's the media content itself. That last one is easy to disregard, it's simply a matter of if you've been hearing that glitchy sound with one file or with everything you listen to.
If it's the earbuds, have you tried using them on anything else like your TV, a computer, another phone? If you can still hear that same problem since they're new you should be able to just get them replaced without a hassle.
But if the problem is with the headphone jack, that can be more involved as depending on which model phone you have it can be relatively easy to repair or something of a complicated project. Do you have (or borrow) any external speakers or headphones that you can plug into your phone to see if that same problem?