Boyle's law does not explain the extraction of energy from hot air, it rather tells us how pressure and volume interact with each other at constant temperature.