On November 29, 1877, Thomas Edison gave the first public demonstration of his tin-foil phonograph. He hollered into a tube: "Mary had a little lamb. Its fleece was white as snow. And everywhere that Mary went, the lamb was sure to go!" The phonograph etched sound waves into tin foil wrapped around a cylinder, making these the first speech ever recorded.
Swapping some parts around, Edison immediately played back the sound. It was hand-cranked and scratchy, but it worked! This was a shocking invention, and led to rapid improvements—using wax cylinders for recording, mass-produced recordings, and also disc-based recordings.
Here's a modern demonstration of basically the same method, using a replica phonograph:
And here's a much more detailed video explaining exactly how it works, and showing various demos:
For more on Edison's early phonograph work, Wikipedia's page is excellent (and has plenty of citations). Also excellent is The Cylinder Archive, a site devoted to cylinder phonograph recordings.
(Note: The photo at the top of this article shows Edison with a later version of the phonograph; check out this patent drawing for a look at the original.)