Either of these will do:
I am sorry, but I haven't been paying attention because all that noise in the next office is driving me crazy.
I am sorry, but I wasn't paying attention because all that noise in the next office is driving me crazy.
Apart from expressing duration, the -ing form tells the listener that you intend to listen from now on.