I was recently watching My Fair Lady and Mary Poppins. How did the actors/actresses “sing” along to the orchestra score? Was the technology advanced enough when these movie musicals were made that they were able to have a studio recording of them singing with the orchestra blaring off-camera and then they lip-synched to it? Or was there an accompanist on the piano off-camera to provide live accompaniment at the exact tempi the orchestra would perform at?
With the former, it seems like it would be devilishly hard to match your lip movements to what you’d sung in studio previously.
With the latter, it seems like it would be devilishly hard to play a full orchestral score on the piano, exactly to the specifications of what the orchestra had played previously.
Or was the orchestra recorded afterwards?
In short I’d like to know what Rex Harrison and Audrey Hepburn were listening to when they were “singing” “The Rain in Spain.” I assume that whatever I learn here was the same method used for all song and dance numbers for all movie musicals.
What am I missing?