You have created a C# script class, called PlaySounds. The script class includes a RequireComponent attribute. It declares that any GameObject containing a scripted object component of this class must have a sibling AudioSource component (note that one will be added automatically if such a component does not exist when the scripted component is added).
The PlaySounds script class has two public AudioClip properties: Pacman Eating Cherry and Pacman Extra Life. At design time, we associated AudioClip sound files from the Project panel with these public properties.
At runtime, the Update() method is executed in every frame. This method checks whether the UP and DOWN array keys are being pressed. If so, it plays the Eat Cherry or Extra Life sounds, respectively– sending the AudioSource component a PlayOneShot() message with the appropriate AudioClip sound file link.
While this is great...