Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search MP3 files

 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i search all the mp3 files in the local disk using a Java program ?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "search"? In other words, what do you hope to find - just the file names, or the contents of ID3 tags as well? Or something else entirely?
 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i give a song name or any other information to the program, it should search the local disk and find the location of the song that match the ID3 content with the given information.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible using Java, although probably not the best approach. See the OtherOpenSourceProjectsFaq for libraries that can extract ID3 tags from MP3s.
 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I have the J ID3 library and it supports for extract the ID3 tag information. But what i want to know is how i go through the directory structure and locates the mp3 files?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching for "directory walker java" or some such will find example code that traverses through a directory hierarchy. MP3 files generally have an ".mp3" extension, so it's easy to spot them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic