Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

php (or JS) to log music files in directory into a database

Posted on 2014-12-15
3
Medium Priority
?
458 Views
Last Modified: 2014-12-15
Can anyone direct me to a tutorial or advise on how to do this:

I have a directory named "music" with 10 (each) mp3, ogg, and m4a music files 930 total)

I want to create a function, that when triggered will, shuffle through the directory and place the files' id3 data (title, artist, album, etc) into a predetermined database

So then I will be able to query a list such as:
song_title, artist, album, time, cover_image, genre, (etc)

and when new songs are added or deleted from the directory, and I retrigger, it will update the DB based on the contents of the directory.

Thank You - Davo
0
Comment
Question by:edavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 40501537
This can only be done using a server side script such as PHP and even then I would look at non web based technologies.  Yes PHP can be run from the command line but there are more purposeful languages such as powershell / vb (windows) and perl, bash/sh on linux.

What's your server environment? Windows / Linux?

Do you need to have a front end interface?  If so, then PHP may be the best option.  Sorry for the questions but they will help get you the best answer.
0
 

Author Comment

by:edavo
ID: 40501775
Linux… And yes it will feed a front end "player" also built in PHP and JS.
0
 
LVL 43

Accepted Solution

by:
Rob earned 2000 total points
ID: 40501807
Personally i would do this in two separate sections.  

One to read the files and import them as indicated here: http://php.net/manual/en/function.id3-get-tag.php.  This will read the files into an associative array where you can pull the relevant data you need and store it in your database.  Your PHP would obviously check if that file already exists or just overwrite it... up to you.  I would set this up as a CRON job or triggered when a new file is uploaded (assuming it is) OR you could run php script manually.

The other to be the front end player using PHP to query and serve the digital content along with javascript to manipulate it.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question