system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How is sound stored in a file and reproduced back?
gpt
Sound is a waveform and anything that is a waveform can be described by numbers. Think of a simple sine wave. If you walk along the x axis you can measure the wave in terms of numbers - x and y. The number of steps you take across the x axis is your resolution and the height of the y axis is your amplitude.      
There are programs called codecs - code and decode - they take the sound coming in over the microphone and convert it into numbers (coding). The numbers are stored in a file. The file format is specific to the codec (.wav, .mp3, .avi etc) . The same codec takes the file and does the reverse. It converts the numbers back into sound vis the speakers.