Firstly, check this thread for how to post code on the forums for future reference: Using code tags properly
Next, do you get any errors? Does the raycast hit?
My other suggestion would be to use the IPointerClickHandler interface, which entails:
- adding “using UnityEngine.EventSystems;” at the top of your script.
- adding the interface (beside ': MonoBehaviour) at the top: “IPointerClickHandler”…
- letting your IDE help you implement the method for the interface.
- putting your logic/code inside the method (accessing/changing the audio source).