Hi There,
I’m Looking to make my own MP3 player App/ visualizer. Everything is going great but I want to locate the MP3 files on the target machine and populate a vector/ array and loop through to play them during runtime so the user has all their music.
How do I go about locating the files on the target machine and checking if they are of the right file type (mp3)
I’ve seen some people suggest streaming? others using URL? Are there any code samples that I can find ?
This is for android!
Thanks in Advance
Here’s what I am trying to do;
private void loadSongs()
{
// Populate an array of song file paths.
folderPath = EditorUtility.OpenFolderPanel(“Locate Music”, “C:/Users/George/”, “Music”);
filePath = Directory.GetFiles(folderPath);
}
then
void Start()
{
loadSongs();
www = new WWW(filePath[index]); // index for now is set to 0 the first array element for testing purposes
source.clip = www.GetAudioClip();
Debug.Log(source.clip.name);
Debug.Log(filePath[index]);
}
I get now error and when I look in the editor the audio source does have an audio clip loaded but it cant read it/recognize it or play it.