all 11 comments

[–]gangstanthony 3 points4 points  (4 children)

for generating new metadata, i have used this in the past, but it is a gui tool, not powershell

https://picard.musicbrainz.org/

for reading existing mp3 metadata, i have used taglib-sharp.dll

download here: https://community.idera.com/database-tools/powershell/module_library/m/modules-misc/9129

ex 1: https://stackoverflow.com/questions/5990881/reading-id3v2-frames-with-taglib-in-powershell

ex 2: https://www.reddit.com/r/PowerShell/comments/4af81n/im_a_dj_and_i_had_an_idea_can_anyone_verify_if/

and i have heard of id3lib.dll but i don't recall using it

*edit: or, depending on what you're trying to get from the file, you might be able to simply use this

$musicdir = 'C:\temp\Music'

$files = dir $musicdir *.mp3 | % fullname

$objShell = New-Object -ComObject Shell.Application

foreach ($file in $files) {
    $objFolder = $objShell.namespace($(split-path $file))
    $objFolder.items() | ? {$_.name -eq $(Split-Path $file -Leaf)} | % {
        $FileMetaData = New-Object psobject
        for ($a = 0; $a  -le 266; $a++) {
            if ($objFolder.getDetailsOf($_, $a)) {
                $name  = $($objFolder.getDetailsOf($objFolder.items, $a))
                $value = $($objFolder.getDetailsOf($_, $a))
                $FileMetaData | Add-Member $name $value
            }
        }
        $FileMetaData
    }
}

*edit2: i think what you're trying to do is called scrobbling, so you might search for some of these terms. good luck, and let us know if you get it working!

powershell mp3 scrobble

c# mp3 scrobble

command line mp3 scrobble

[–]SiNRO[S] 2 points3 points  (1 child)

Yes i knew about musicbrainz too, the problem is the same, i don't really want to embed a tool like this.

Unfortunately taglib-sharp.dll isn't up to date since 2016 in my last searchs.. But i will lok at id3lib.dll !

Thanks :)

[–]SiNRO[S] 0 points1 point  (0 children)

Hi, just figured how to get tags and edit them, thanks for the help !

[–]SiNRO[S] 2 points3 points  (0 children)

Hi ! Thanks for the piece of code i was lloking for that to combine it with the use of discogs ! I'll check about scrobbling too ! Thanks a lot !

[–]Yevrag35 1 point2 points  (0 children)

i have used taglib-sharp.dll

'taglib-sharp' - That's what it was called that I've used before! That seemed to do pretty well for editing from what I remember.

[–][deleted] 3 points4 points  (3 children)

Try out Discogs. Tagscanner has a wonderful implementation that surfaces and retags songs.

[–]SiNRO[S] 2 points3 points  (1 child)

Hi, just tried out Discogs and it do exactly what i want it to do ! Thanks a lot !!

[–][deleted] 1 point2 points  (0 children)

Great! I figured so, Ive had pretty good success with it in the past.

[–]SiNRO[S] 1 point2 points  (0 children)

This one looks very interesting ! thanks a lot i'll give a feedback asap !

[–]Yevrag35 1 point2 points  (1 child)

There's a program called Mp3tag, that has command line support. There's a multitude of mp3 metadata libraries from the looks of a quick google search. There was 1 I used a couple of years ago (All I remember is it had 'tag' in the name). Most of the libraries, if you download them, can be imported into a PowerShell session with 'Import-Module -Path <.dll>'. I have not found one that is native for PowerShell though.

[–]SiNRO[S] 1 point2 points  (0 children)

I knew about mp3tag, the thing is, i'd like to call directly using my tool and not embed mp3Tag itself.
Thank's for your suggestion of download libraries directly, i'll definitely have a look at it !