Al0.6Ga0.4As x-ray avalanche photodiodes for spectroscopy