New Articles
Windows 11 users have discovered a funny bug that benefits older computers....
It's easy to turn off the transmission — we tell you how to do it....
Such photos have been taken by models and social media users for a long time,...
A famous musician? A schoolteacher? Mom? Tell us about the people you looked up...
Thanks to the instructions of Artyom Kozoriz, you can cope no worse than a...
5 interesting exercises that will help you develop flexibility....
From "Starship Troopers" and "The Matrix" to...
The return of Garfield and Mufasa, the new Transformers and the Lord of the...
Trickben.com » Leisure » Samodelkin: About PowerShell and Audio books

Samodelkin: About PowerShell and Audio books

04 May 2023, 18:12, parser
0 comments    0 Show

I don't know about you, but I "read" audio books with pleasure. And I got hooked on this case because of traffic jams, probably. Sorry for the time.

Uploaded on July 13, 2009 by ĐāżŦ

But even after buying a disc, I don't listen to the disc, it's inconvenient — the player doesn't remember the position when changing discs. This is extremely inconvenient. The iPhone/iPod is much better suited for these purposes (although another mp3 player may be suitable, but with some limitations). Everything is remembered and you start from the place where you finished the previous "session". And you can continue "reading" on the computer exactly where you finished on the device — the advantage of the Apple infrastructure is obvious. Although iTunes is a thing for a very special taste.

But here I regularly have problems with sorting, disc manufacturers do not record track numbers in tags, and without this Tuna, and the iPod after it, are lost.

Therefore, I turned my gaze towards PowerShell, knowing that the thing is powerful. The result was an imperfect but working script offered to your attention:

$TagLib = «C:Librariestaglib-sharp.dll»
[System.Reflection.Assembly]::LoadFile($TagLib)
$trackNum = 1
get-childitem *.mp3 | foreach {
$Media = [TagLib.File]::Create($_.fullName)
$Media.Tag.Track = $trackNum
$trackNum = $trackNum + 1
$Media.Save()
}

In order for it to work correctly, you need to go to the folder with the list of files of interest. Adding the parameters of the initial track number and working directory is not difficult at all, try to do it yourself.

I will add that you need to run the script BEFORE you add tracks to iTunes.

Screenshot of the folder before using the script

and after:

Read more. Yes, I almost forgot — you need to download the taglib library, which is not only mp3 on the shoulder.

Read also:
27 Jan 2024, 12:00    0    0
Be patient: with proper care, the fruits will have to wait at least 8-10 years....
Comments
reload, if the code cannot be seen