I am creating my own mp3 player. For the mp3 player I need a song searching facility same as VLC Media Player and Rhythmbox and other media players, in which one can search for a song by giving artist/track/album name.
As an example consider these are 4 songs with their respective meta data
Track Artist Album
Dear Agony Breaking Benjamin Test Name
Radioactive Imagine Dragons Billboard
Feel Good Drag Anberlin Random
Khamaj Fuzon Tere Liye
Now suppose I give search query: ag
then result should be this:
Dear Agony Breaking Benjamin Test Name
Radioactive Imagine Dragons Billboard
Feel Good Drag Anberlin Random
because first three song have some occurence of ag
in the meta data however the fourth track doesn't have any hence it shouldn't be listed.
All the mp3 files will have all these data present in them, and I know how to extract this data from them. The real challenge is which data structure to use and how to use that data structure to implement this.
Especially if user's song playlist is very big then a efficient retrieval of results is required. Please suggest some data structures which I can implement to achieve this. By the way I am using Python
ALL_TAGS COMPUTED BY TAG_ALBUM || ' ' || TAG_BAND || ' ' || TAG_TITLE || ... ) and then do like
SELECT ID FROM SONGS WHERA ALL_TAGS LIKE '%ag%'` Would be a linear search reading from HDD, so not very fast (about 100 MBytes/sec for raw speed). But simple. And in memory everythign would be fast... – Arioch 'The