How to make 2 sounds play on key press

I was wondering how to make it so that when up arrow is pressed one sound will play but when you let go of the up arrow another sound plays. I tried the script but it didnt work.
Thanks!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayonW : MonoBehaviour
{
    public AudioSource someSound;
    public AudioSource someSound2;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            if (!someSound.isPlaying)
            {
                someSound.Play();
            }
        }

        if (Input.GetKeyUp(KeyCode.UpArrow))
        {
            someSound2.Play();
        }
    }

Hi itsdandd,

My first thought would be that the “mute audio” button is pressed under the Game tab. This just mutes all audio from the game when playing. Hope this helps!

The audio is not muted i just checked. I think there is something wrong with the script.

Thanks for the speedy response!

Please note for the future that there is a forum for Audio here where you’re likely to get help quicker. This forum is for 2D features.

Thanks.