Audio.PlayOneShot is making player unable to jump

So I was trying to add in some sound effects, but when I tried using Audio.PlayOneShot which everyone suggested as the easiest way its making the player stay grounded and unable to jump. Here’s the bit of code I have for jump.

			if(Input.GetButtonDown("Jump")){        

				amountToMove.y = jumpHeight;  //Jump
				audio.PlayOneShot(jump);
			}

The variable jump is a public Audio Clip, and I attatched the jump.mp3 sound effect.

Do you get any errors when the button is pressed?

Oh yes I didst realize I was getting an error in the console. This is what it says,

“MissingComponentException: There is no ‘AudioSource’ attached to the “Player” game object, but a script is trying to access it. You probably need to add a AudioSource to the game object “Player”. Or your script needs to check if the component is attached before using it.”

But I do have the audiosource attatched to the script of the player.

Edit: I figured it out thank you!