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
4 answers

How to download image from URL and save as MP3 album art in Python using Mutagen

I have a python program that reads an mp3 and returns a URL of it's album art. However, when I download that image using requests and then use mutagen to set that image as the album art of my mp3 it doesn't return any errors but the album cover is…
0
votes
0 answers

How to change the title of audio before downloading in yt-dlp

Metadata of any song which has '|' in title is not being extracted so i want to change '|' to '-'and then download but it doesn't change. When i run this code it does download audio but doesn't change | to -. import yt_dlp from mutagen.easyid3…
0
votes
0 answers

Mutagen using forward slash as delimiter

I'm using mutagen to collect information about given MP3 files. It's working but there is one problem. When a song has mutliple artists it uses a forward slash as a delimiter. So the TPE1 tag may return the following when the song is, e.g., a…
Anteino
  • 1,044
  • 7
  • 28
0
votes
0 answers

Trying to create mutagen session in remote ubuntu and got the error (Mac Os ventura)

mutagen forward create unix:/tmp/remote-docker-on-ubuntu.sock ubuntu-remote:unix:/var/run/docker.sock -n remote-docker-on-ubuntu I have used this command but hit this error Error: unable to connect to destination: unable to connect to endpoint:…
psimanta
  • 46
  • 4
0
votes
0 answers

Cannot read ID3 tag from mutagen in Tag&Rename

I have a weird problem writing an ID3 tag to an MP3 file with mutagen. More specifically the album sort tag (TSOA). The code I am using: from mutagen.id3 import ID3, TSOA audio = ID3("sample.mp3") audio.add(TSOA(encoding=1, text=u"Great Album,…
Arete
  • 948
  • 3
  • 21
  • 48
0
votes
3 answers

How to get the mp3 link duration when playing in vlc python?

I was trying to play music from music stored in Firebase Storage using vlc packages. However, when using this packages, we need to define the duration of the time sleep. Error occured when I used urllib.request and mutagen library to retrieve…
Wesley
  • 65
  • 9
0
votes
1 answer

Mp3 duration doubling after mutagen.py edits in iTunes only

I am trying to create a python code that edits a mp3's info and adds the title, artist, and album. This will make it so that when it's opened in iTunes, I don't have to manually add the info to the song. After I open the mp3 file in iTunes, the…
0
votes
1 answer

Would using mutagen-compose be better than a multistage docker build?

Using MacOS, I have a docker compose that uses three services in the following way services: service_1: volumes: - ./apps:/usr/src/app/apps - ./packages:/usr/src/app/packages\ build: dockerfile: Dockerfile service_2: …
Joe
  • 13
  • 3
0
votes
1 answer

mutagen or eyed3: identify and read ID3v1

Most of my MP3 files are tagged with both ID3v1 and ID3v2. I want to write a script to read the files and identify ID3v1 versions, regardless of additional ID3 versions. I'm struggling with the following code (eyed3). isV1 is only True if ID3v1 is…
ralf
  • 13
  • 3
0
votes
2 answers

How to handle Japanese characters?

I have an input in Japanese language from other source which is out of my control. But I get this error: UnicodeEncodeError: 'charmap' codec can't encode characters in position 15-41: character maps to undefined Code: import mutagen def…
0
votes
1 answer

ModuleNotFoundError: No module named '' - Installation error

I am building a desktop app using Python and PySimpleGUI. So far, everything works just fine. Whilst I was working at the project, I realized I need to find a way to get the duration of some mp3 files and to display it in a certain way. I…
geekt
  • 1,979
  • 3
  • 10
  • 20
0
votes
0 answers

Getting song lyrics using python mutagen

I'm new to python. I have been practicing the use of mutagen module for mp3 metadata. I encountered lyrics of my file on the screen.This is the screenshot I took from my terminal this is my code: import mutagen from mutagen.flac import FLAC from…
0
votes
1 answer

TypeError: object of type 'ID3TimeStamp' has no len()

I have made this code, to get the year from an mp3, and if i print it, it works, but when i write to text box in my webpage, it gives an error(traceback below), but not always, sometimes the error not show, so i suspect it is from the way the mp3 is…
Rose
  • 65
  • 1
  • 1
  • 7
0
votes
2 answers

Python 3.8 Mutagen wont read GEOB tag

I'm using PyDev with Eclipse. Mutagen installed through Anaconda. I have experience in C, but decided to give Python a shot. Not sure why this isn't working, and there's not a lot of examples for Mutagen. This is a simple mp3 that I'm trying to read…
krose
  • 390
  • 1
  • 6
  • 18
0
votes
3 answers

I am getting this error while converting .m4a files to .mp3

I am getting this error while runnthe script as shown TEST.py from pydub import AudioSegment wav_audio = AudioSegment.from_file("Broken Summer.m4a", format="m4a") wav_audio.export("audio1.mp3", format="mp3") The error is as shown…
Kartikey
  • 4,516
  • 4
  • 15
  • 40