Which device converts heat energy into mechanical energy

Electrical motor

Generator

Steam engine

Loudspeaker