Hi
I wonder if somebody would be kind enough to guide me. I am currently using the following code to index mp3 songs within the music folder on my kindle fire -
This works fine for me on songs in the root which is what I expected. I now however would like to find all songs in this folder under sub folders etc and wonder is there a better way to get the mp3 paths ?
Do I need to read every folder and then check for files in them or is there a simpler way to find all my music ?
Many thanks
Mike
I wonder if somebody would be kind enough to guide me. I am currently using the following code to index mp3 songs within the music folder on my kindle fire -
B4X:
Try
root=File.DirRootExternal
path1 = root & "/music"
Dim fileList As List
Dim n As Int
tunepath=path1
'Search for mp3's
fileList = File.ListFiles(path1)
temp=filelist.Size-1
For n = 0 To fileList.Size-1
file1 = fileList.Get(n)
If (file1.EndsWith (".mp3")) OR (file1.EndsWith (".MP3"))Then
progbar1.Visible=True
If counter<1001 Then 'was 1500
musiclibrary(counter,1)="/"& file1
lblmikedent.Text="Indexing Song - " &counter
LogMp3Tags(path1, musiclibrary(counter,1))
counter=counter+1
End If
End If
Next
This works fine for me on songs in the root which is what I expected. I now however would like to find all songs in this folder under sub folders etc and wonder is there a better way to get the mp3 paths ?
Do I need to read every folder and then check for files in them or is there a simpler way to find all my music ?
Many thanks
Mike