My favorite version of this hack is Renault changing the RPM of their F1 engine to play God Save The Queen: https://www.youtube.com/watch?v=XRXwWbo_mX0
Electric motors and speakers are basically the same things. Speakers are optimized to be more efficient at producing sound, motors are optimized to be more efficient at moving things, but at the core, they're the same device.
Not only that, you can superimpose audio on the intended operation of the motor by putting the signal on the "D axis" which produces no torque. Unless you're in field weakening blah blah blah... But only higher frequencies are typically possible.