Questions tagged [mutagen]

Mutagen is a Python module to handle audio metadata.

Mutagen is a Python module to handle audio metadata.

It supports ASF, FLAC, M4A, Monkey's Audio, MP3, Musepack, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, WavPack and OptimFROG audio files.

All versions of ID3v2 are supported (for reading), and all standard ID3v2.4 frames are parsed. It can only write ID3v2.4 (and ID3v1.1) so it is not compatible with libid3 nor Windows Media Player (which still require ID3V2.3 as of 2013). It can read Xing headers to accurately calculate the bitrate and length of MP3s. ID3 and APEv2 tags can be edited regardless of audio format. It can also manipulate Ogg streams on an individual packet/page level.

Home Page: http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen

146 questions
0
votes
1 answer

How to get the lyrics of a song from the song file using python

How can I access lyric tag of an mp3 using python modules? Assume mp3 already has lyrics tag filled with track's lyric.
Arian Shariat
  • 35
  • 2
  • 6
0
votes
1 answer

How to use mutagen on a directory?

from mutagen.flac import FLAC audio = FLAC("/file/path") audio["comment"] = "This is my comment" audio.save() I checked it tags the Flac file if I give file path. But how to run this on all files present in their respective album name folders?…
0
votes
1 answer

Mutagen: Save ID3 tag to variable

I'm trying to create an ID3 tag and save it to a variable, rather than outputting it to a file. Is there any way to do this? This works for saving, but I can't find a way to simply save the raw bytes in a variable, without having to write out a file…
Andrew
  • 107
  • 8
0
votes
1 answer

Mutagen: TypeError: a bytes-like object is required, not 'str'

What should I do? I'm getting this error. I want add some tags for FLAC. I searched but i didnt find anythings. Please help me. Traceback (most recent call last): File "indir.py", line 50, in audio.save() File…
quiec
  • 15
  • 3
0
votes
2 answers

"ASFUnicodeAttribute" problem when printing wma song titles with mutagen

Hey guys I recently started working with mutagen and I'm facing a very annoying problem. Let´s say I´m trying to print the title of a wma file with mutagen: from mutagen.asf import ASF song=r"C:\Users\j2the\Music\The One and Only\Rammstein\Made…
0
votes
1 answer

mp4 metadata not found but exists

I want to change the creation date of mp4 files (wrongly configured in recorder) but mutagen seems to not find the proper metadata: import mutagen from mutagen.mp4 import MP4 path = 'borrar.mp4' file = MP4(path) for tag in file: print(tag, ':…
Paco Abato
  • 3,920
  • 4
  • 31
  • 54
0
votes
2 answers

Python read MP3 cover file

I am trying to read the cover from an MP3 file with the following code. import tkinter as tk from PIL import Image, ImageTk from io import BytesIO import mutagen from mutagen.id3 import APIC root = tk.Tk() image_bytes =…
Franc
  • 39
  • 2
0
votes
1 answer

How to get album image from a music file using Mutagen and python?

I checked this answer but it doesn't work. Here's my code: from mutagen.id3 import ID3 music = ID3('music.mp3') music.get('APIC:').data I get following error: 'NoneType' object has no attribute 'data'. I also tried to find out the field name using…
Sphinx
  • 394
  • 3
  • 17
0
votes
0 answers

UnicodeDecodeError when installing mutagen pip

So I wanted to install the pip 'mutagen' on my PC. I using python 3.6. When I tried to install the pip on my PC, I got this error: Exception: Traceback (most recent call last): File…
0
votes
0 answers

How can I get the ISRC and UPC code from an audio file with python mutagen

I have a music file (bought on amazon). With this service https://www.get-metadata.com I figured out, that there is a upc and isrc code somehow in the file. The data is in this tag "Id3V2 Priv.www.amazon.com" and inside a xml. My problem is, that i…
vkuzma
  • 130
  • 11
0
votes
1 answer

Adding ID3 Tags in Mutagen by Looping Through a Directory

(I'm an absolute beginner in terms of coding, this is my first ever project.) I'm trying to use Mutagen on Windows 10 to loop through a directory and add ID3 tag track numbers for each of the files encountered. Unfortunately, it seems Mutagen is…
0
votes
3 answers

Python - two strings appear to be equal but are not

I’m trying to figure out why two strings which appear to be equal in python are not equal. There appears to be a similar question posted Why are my two python strings not equal in my program but equal in the interpreter? but this does not address my…
Self Dot
  • 352
  • 3
  • 14
0
votes
2 answers

How to get the rating tag of an mp3 with mutagen?

I tried mutagen EasyID3 class to retrieve this tag (on mp3s I am sure this tag exist) and it doesnt show up in the list of tags returned. It is the Itunes rating tag I am talking about. It seems I lack an important information about this particular…
Yannick
  • 1,550
  • 4
  • 18
  • 27
0
votes
2 answers

How to I obtain the Album picture of a music in Python?

I am trying to insert the album pictutre of a music(mp3) as an image in Python GUI window. I used mutagen ID3 picture class for this purpose. It was described in the docs but I excactly dont know how to do it. So kindly I would like to request for…
Toru
  • 3
  • 1
  • 4
0
votes
2 answers

Removing the [''] format from a file

I have to rip my cd library in Flac to archive them and long story short the filename when ripped doesn't include the track number, which is throwing off the playlist order when played on my audio player. To save the trouble to rename them manually…
François T
  • 43
  • 1
  • 4