question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Songs should be saved with the same tag info they were opened with

See original GitHub issue

Currently, by default a song imported with AudioSegment.from_file and then saved with song.export(name) is saved as the same format it was opened with. It would be very helpful if the tags could remain, too. So if the tags argument isn’t provided for the export method, it would use whatever metadata was there originally.

I hope this makes sense.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
marcwebbiecommented, Dec 18, 2013

In the meantime, if you cloned pydub git repository, check utils function called mediainfo to extract TAG metadata for exporting segments.

Extracting tag metadata from media file using mediainfo function:

In [12]: from pydub.utils import mediainfo

In [13]: mediainfo('stromae-formidable.mp3').get('TAG',None)
Out[13]: 
{'album': 'Racine Carrée',
 'artist': 'Stromae',
 'comment': 'Cover (front)',
 'date': '2013',
 'genre': 'Pop',
 'title': 'Formidable',
 'track': '6'}

From python:

from pydub import AudioSegment
from pydub.utils import mediainfo

seg = AudioSegment.from_file('original.mp3')
seg.export('out.mp3', format='mp3', tags=mediainfo('original.mp3').get('TAG', {}))

Hope that helps.

0reactions
wal1624commented, Jun 30, 2022

This issue is not fully resolved as many, including me, keep coming across the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Automatically Tag and Organize a Music Library ...
This tutorial will show you how to turn a mess of music files into a perfectly organized library sorted into folders by Artist/Year/Album....
Read more >
Adding Labels and Descriptions into Your Audio Files
Run whatever media player you use to play music on your computer and open up the MP3 file. As the song plays, does...
Read more >
How to Edit Music Tags on an Android
Tap "Fix" next to a field you want to edit, and then tap the desired information. Tap "Save & Close" when you are...
Read more >
Change song and CD information in Music on Mac
Change the song name: Select the song, choose Song > Info (or press Command-I), click Details, make your changes, then press Return. Tip:...
Read more >
How to edit music metadata info on Windows 10
In this guide, we show you two quick ways to update song or album metadata to display the correct information while playing locally-stored...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found