I would like to scan music files and read / write metadata using Elixir (this entire project is dedicated to learning Elixir - so please don't tell me to use Python!). As far as I understand, I have two options: to call the system utility or (since there are no libraries in Erlang or Elixir), write the Elixir library. For m4a files, I make an MP4Box system call and write the xml file to disk. Then I read in the file, parse it and load the data into the database.
def parse(file_name) do System.cmd("MP4Box", ["-diso",file_name]) Ainur.XmlParser.parse(xml_file_name(file_name)) |> get_tags end
Very slow, especially for thousands of files. And I want it to run on every start to check for changed / new files.
Now I'm trying to do the same for mp3 with id3 tags. I tried libid3-tools on Ubuntu and found only id3v1 tags. eyeD3 detected only id3v2 tags. My mp3 has both, so I need to make sure they are the same (I suppose I could remove the id3v1 tags, but I was convinced that the id3v1 tags are necessary for outdated equipment).
Are there Erlang or Elixir libraries for musical metadata? If not, are system calls the ubuntu utilities the best choice (any recommendations for them)?
Or do I need to write a library to get reasonable performance? If so, is there an existing library in a functional language that I could try to execute?
Or can you call a library written in another language directly from Elixir (without a system call)?
source share