There is an interesting service celled The Echo Nest that is a music API you can do a lot of interesting things with like The Count. But if you (like me) have music that is a bit outside the mainstream there is the problem that they do not know about it. So I hacked together a simple package to upload mp3 files to their servers for analysis.
First you need
- cURL
- an API key from Echo Nest Dev Center
I created the directory C:\CURLER and put curl.exe there. I also created two batch files.
One called CURLER.BAT as
@echo offReplace YOUR_API_KEY with the API key you got from the Dev Center.
echo %1
C:\curler\curl -X POST -H "Content-Type:application/octet-stream" "http://developer.echonest.com/api/v4/track/upload?api_key=YOUR_API_KEY&filetype=mp3" --data-binary @%1
timeout /t 2
This file takes the file name of an mp3 file and uploads it to Echo Nest's servers. It does not check if they already know about it (sorry about that, I'll try to make something better later).
Well, that works, but it is a bit tedious so I made another batch file I called ALLMP3.BAT and it looks like
@echo offIt takes a directory name as parameter and loops trough that and all subdirectories of it and sends them.
FOR /R %1 %%G IN (*.mp3) do call C:\curler\curler.bat "%%G"
Inga kommentarer:
Skicka en kommentar