• Resolved haikuluke

    (@haikuluke)


    Hi There,

    I see that you are unavailable til the 21st, but just wanted to post my question here in case it is helpful for others. Hope your time away was good!

    I am trying to extract on upload and existing files a line out of my audio file’s metadata, ideally having that information end up in the “tags”.

    Quick overview: have hundreds of music files of my compositions. As I added them to itunes I added mood tags to the “comment” field of itunes’ file info. I could just go through and manually do this, but as this is an ongoing project it would be nice if these autopopulated on upload. The end goal is to show people who are interested in using my music for film only audio tracks that are the tag “moody” or “upbeat” etc.

    I have read documentation and I apologize if this has been addressed… after many hours of trying to figure this out on my own I just have to ask for help!

    What I think I need to do is add the code
    template:[+id3,extract(‘comment)’)+]
    or is it
    template:[+id3,comment+]
    or is it
    template:[+id3,’comment’+]

    to the EXIF/Template Value field.

    etc. point is, I do work with code a lot but can’t figure this out! I apologize, I did indeed read the documentation and forum posts that seemed to apply :/

    …I know that ‘comment’ exists, I can see it in the Attachment Metadata field… I just don’t know how to get to it! It looks like this (copy and paste transformed => into =>):

    array (
    ‘dataformat’ => ‘mp3’,
    ‘channels’ => 2,
    ‘sample_rate’ => 44100,
    ‘bitrate’ => 256000,
    ‘channelmode’ => ‘stereo’,
    ‘bitrate_mode’ => ‘cbr’,
    ‘lossless’ => false,
    ‘encoder_options’ => ‘CBR256’,
    ‘compression_ratio’ => 0.181405895691609975184377390178269706666469573974609375,
    ‘fileformat’ => ‘mp3’,
    ‘filesize’ => 10954461,
    ‘mime_type’ => ‘audio/mpeg’,
    ‘length’ => 342,
    ‘length_formatted’ => ‘5:42’,
    ‘title’ => ’12 stormy brewy 020118′,
    ‘artist’ => ‘Luke Janela’,
    ‘band’ => ‘Luke Janela’,
    ‘composer’ => ‘Luke Janela’,
    ‘track_number’ => ’12’,
    ‘year’ => ‘2018’,
    ‘genre’ => ‘Alternative’,
    ‘comment’ => ‘moody,ethereal,cello’,
    ‘encoded_by’ => ‘iTunes 12.8.0.150’,
    ‘album’ => ‘REVERIES 18 – MITR’,
    )

    I’d actually love the power to do more with this info.

    Your plugin is absolutely amazing, hope your time away was good, and I can’t wait to put it to use!

    • This topic was modified 6 years, 4 months ago by haikuluke. Reason: clarification
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for noticing that I am away from my development system until October 21. Thanks as well for including the details on your item’s Attachment Metadata; very helpful.

    It looks like you have two ways to access the information you want. First, you can access the original “ID3” content in the file itself. Your templates need a simple syntax adjustment to get what you need. The “id3:” portion is one of the “prefix” values that tell MLA where to look for the data. All prefix values are followed by a colon, e.g., you can try:

    template:[+id3:comment+]
    

    You can find more information about accessing ID3 values in the “Field-level Prefix Values” section of the Settings/Media Library Assistant Documentation tab, including some tips on exploring all of the available data in your file(s).

    The details you posted are from the “Image Metadata” that WordPress extracts from the file and stores in the database. You can access these values using the “meta” field-level prefix, e.g.:

    template:[+meta:image_meta.comment+]
    

    I am not sure that the “meta:” values are available during the initial upload process and I can’t test that until I return home.

    I hope that gives you what you need to make some progress. If you still have trouble, you can post a link to one or more of your music files and I can investigate further when I return home. I will leave this topic unresolved for now; good luck!

    Plugin Author David Lingren

    (@dglingren)

    I have returned home and I can give you more guidance if you need it. Please let me know what I can do to help.

    Plugin Author David Lingren

    (@dglingren)

    It has been seven weeks since the last post in this topic. I hope the suggestions I gave helped you find a solution that works for your application.

    I am marking this topic resolved, but please update it if you have any further questions about extracting metadata from audio files. Thanks for your interest in the plugin.

    Thread Starter haikuluke

    (@haikuluke)

    Hi David,

    Just wanted to take a moment to thank you both for your very helpful response and for the work you’ve done on this in general. Because this project is for my own betterment I have procrastinated on it terribly… But I plan now to dive back in, hence the very delayed response. I’ll keep you posted on what I find… if I can get this to work (and even if I don’t) your plugin is a lifesaver. Thank you.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update. If there’s anything I can do to help, post an update here. Good luck!

    Thread Starter haikuluke

    (@haikuluke)

    Hi David,

    Again, I am amazed by the generosity of your technical know how and continue to chew on how incredible this plugin is.

    I just wanted to let the forum show for the record that I successfully have the foundation for mapping tags based on the ‘comment’ section of an itunes…

    I feel like I am likely one of 7 people on this planet that actually “need” this function… nonetheless I want to document the (very basic, but for me it took a bit of trial and error to accomplish) steps that I took to make this happen.

    To recap: the metadata of an attached audio file showed that indeed, the “comments” field was being ‘pulled’ via id3 tags… it said:

    ‘comment’ => ‘moody,ethereal,cello’,

    David took the time to let me know that the way to “pull” this info was to use the term: template:[+id3:comment+]

    So. What I did was:

    Go to Settings -> Media Library Assistant
    Click on the IPTC/EXIF tab
    In my case I wanted the “Tags” to be populated by the “Comment” so I clicked Edit underneath “Tags” in the list of fields to the right (I could have also used Quick Edit)
    In the “EXIF/Template Value” field I entered the text: template:[+id3:comment+]
    I chose Exif as Priority (I don’t know if this is important)
    In my case I chose “Keep” for existing text as I hoped to run this on existing files
    I used a “,” delimiter, so that multiple tags would be created if I had multiple moods in my comment
    I set the status to Active

    This has made it such that when I upload files that have data in the comment field of my audio files, it automatically converts those into tags.

    I have used the exact same uh… approach to making “Category” be populated by my “Genre” from my audio file.

    So for me the ultimate end goal is to have a clickable tag cloud based on moods… I use the “comment” field to represent the moods of the track I have just recorded.

    I am not 100% there yet as now I need to figure out how to (ideally) automatically create posts from these audio uploads, such that when a user clicks on a tag, it takes them to a page (archive?) of audio files of that particular tag. For example, clicking the tag “cello” would take you to all the songs I’ve recorded that use Cello. I may have to manually create posts for each of these… (any thoughts on this @dglingren ?)

    Additionally I will be creating a very similar situation out of categories. In my oh so artistic way I am using the categories North East South and West as my overarching mood categories. I don’t know why I just see North as lonely and cold, East as exciting, South as mysterious and West as warm and invigorating. I’ve been using that system for years so it will be the “parent” and thus has a category rather than a tag.

    So. I’m almost there. I doubt that this will help many people as I think most users have a more advanced working knowledge of wordpress than me. But in case it helps there you have it.

    I’m very grateful for this plugin and am always amazed at people who take their valuable time to contribute to projects like mine without asking for a thing. THANK YOU and cheers. I hope to pay it forward myself in other ways.

    Thread Starter haikuluke

    (@haikuluke)

    Sidenote: I forgot that I need to research how to accomplish my end goal ideally using the mla_gallery shortcode… looking at now (finally)

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your generous updates with the details of your progress. You wrote:

    I am not 100% there yet as now I need to figure out how to (ideally) automatically create posts from these audio uploads, such that when a user clicks on a tag, it takes them to a page (archive?) of audio files of that particular tag. For example, clicking the tag “cello” would take you to all the songs I’ve recorded that use Cello.

    This is a fairly common application, and you can use MLA shortcodes to create a page with a cloud or term list that displays a gallery of matching items once a term is selected. Have a look at in the Settings/Media Library Assistant Documentation tab for the “Tag Cloud and Gallery”, “Search Form and Gallery”, “Tag Cloud Pagination Example” and “MLA Term List Examples” sections.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Extracting audio file metadata’ is closed to new replies.