Yeah true, but a player piano requires inventing the piano ;)
It’s definitely possible to make a recording without electricity, it just requires steady source of rotation for engraving, so maybe a spring or motor was a necessary precursor to make it useful.