I almost always listen to music while writing. It helps me focus. Generally, it has to be songs I already know. Otherwise, I'm paying too much attention to the music.
For epic fantasy, I love listening to power metal. Blind Guardian and Hammerfall are two of my favorites. When I'm really in the mood for cheesy fantasy-inspired music, I listen to Gloryhammer, which is pretty much a parody of the power metal genre (and a lot of fun to listen to). I also listen to a lot of Kamelot, which is kind of power metal crossed with symphonic metal and progressive metal. Their stuff, especially more recently, isn't as much fantasy-inspired as some of the others, but it still works well for me.