When was the first sound recording by Thomas Edison invented?

The first sound recording by Thomas Edison was invented in 1877 . It was called the phonograph , and it used a tinfoil cylinder to record and playback sound.