Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get current sound clip file name in Unity c#?

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SongName (UnityEngine.AudioClip)

Thanks in advance!

>Solution :

Suggestions:

I believe this returns you the name of clip…

audioSource.clip.name

Hope it works… Happy coding 🙂

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading