He recorded the electronic code-sequence onto the magnetic tape, then played the tape back to replay the code-sequence into the locking mechanism. The fact that we can hear audible tones seems to be largely incidental.
Cautiously he placed the panel on the floor, then rose up and peered into the control wiring and retrieved the cassette recorder, wired into the mechanism with the earphone cord.
He rewound the tape and moved the jack from “input” to “output.” This was it!
His forefinger hit the “play” button.
Faint tones sounded—an exact repetition of the unlocking sequence. The door lock hummed quietly and clicked. Then, with malicious glee in his eye, he pulled a very important wire.
War Games: Official Novelisation
And yes, I'm aware that this is dumb, but that's Hollywood for you.