Which device coverts mechanical energy into electrical energy?

Electrical motor

Steam engine

Generator

Loudspeaker