What is an AFM file?

AFM file
But why do you think you need one?

Check that the library you are using is suitable for the Mega.

How have you wired up the Arduino to the speaker?