Home > Back-end >  How to get current sound clip file name in Unity c#?
How to get current sound clip file name in Unity c#?

Time:08-30

I have a script that basically plays music from the list. I'm trying to get a name of the current song but in return I get the name (UnityEngine.AudioClip)

Here's a code I use:

currentSong.text = audioSource.clip.ToString();

Is there a way to get rid of (UnityEngine.AudioClip)? Because right now I get:

SongName (UnityEngine.AudioClip)

Thanks in advance!

CodePudding user response:

Suggestions:

I believe this returns you the name of clip...

audioSource.clip.name

Hope it works... Happy coding :)

  • Related