"Popular songs don't often get a second chance, especially when they fail the first time around. Its inclusion in one of America's best loved movies transformed "As Time Goes By" into one of our most popular songs twelve years after it initially flopped."
Herman Hupfeld wrote "As Time Goes By" for a Broadway musical play in 1931. In the original show, it was sung by Frances Williams. "As Time Goes By" had been part of the story from the original play. When Warner Bros. turned the play into a movie, they kept the song because Warner owned the publishing rights. The song was re-introduced in 1942 in the film "Casablanca", it was sung by Sam (Dooley Wilson) in the movie, but Wilson could neither play piano nor sing. Warner considered giving him lessons but eventually decided to let him sing only and dub his piano playing by pianist Elliot Carpenter. Composer Max Steiner, hired to write the movie's score, thought "As Time Goes By" was weak and conviced the producer to let him write his own composition to replace it, but the actress Ingrid Bergman had already cut her hair short for her next role in another film and could not re-shoot the scenes which incorporated the song. "As Time Goes By" survived by the timing of a haircut.