Answer the question
In order to leave comments, you need to log in
How to load an audio file from the global directory into the AudioClip variable?
I am making an audio player for the editor and would like to be able to play files from the global directory.
How can this be done?
AudioClip musicTrack = AssetDatabase.LoadAssetAtPath(trackNames[i], typeof(AudioClip)) as AudioClip;//probably not right?
Answer the question
In order to leave comments, you need to log in
Unity will not be able to convert files outside the Assets folder to its format. Therefore, before a file can be referred to as an AudioClip, the file must be placed in a project and imported.
If you need to automatically import sound files, then this is done using the AudioImporter
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question