I read the book several years ago (2005-ish?). I don't think it was new at the time, but it is at least that old.
Here's what I remember:
There are two large empires, ruled by nearly-omnipotent wizards. Between the two empires, the land is divided into many small countries. There is a resistance movement against the wizards, but they know they need to take out both at exactly the same time so that the other one doesn't take over everything.
The main character (narrator?) has the ability to recall details perfectly (like photographic memory, but also for sounds, etc). At one point, he's working with a group of traveling musicians. He is a young-ish (late teen?) male.
There's one scene where one of the characters has faked his own death to try and attack one of the wizards. During this scene, the main character (narrator?) is hiding in the attic, eavesdropping. Eventually in this scene, the one person who knows he's there calls him down to share what he learned by listening. In the big final battle, there are a bunch of lesser wizards that pretend to help the one wizard to force the other wizard into depleting himself in one giant attack. They back out at the last minute and let the wizard they were helping get blasted. There was some other story arch that followed a lady that was trying to work her way into the trust of one of the wizards. She succeed, but ends up falling in love with him by the end.
Not part of the story, but in the notes from the author (preface?), he mentioned patterning the geopolitics of the world after Italy (during the Renascence or middle ages or something), where there were a bunch of smaller countries/kingdoms/lands that would align themselves with this or that larger power for short-term gain rather than uniting and throwing off all the foreign powers.