A device for recording audio signals via magnetized tape was first invented in 1935. By the late 1960s, magnetic tape cassettes were common, largely supplanting phonograph records.
Take a look at the tape recorder demonstrated here.
Current passing through tiny electromagnets generates a magnetic field above a magnetized tape. This is at the heart of how a tape recorder works.