so before I connect my speaker to the arduino it goes through the digital potentiometer first right?
Not quite, the order goes:-
Arduino tone out -> digital Pot -> audio amplifier -> speaker
X9C103P Digital Potentiometer will this be okay to do the job? I
Yes