3

I am extracting embedded ID3 tags from an audio file that has keys.I am using pytaglib and extracted information looks as below:

{ u'ALBUM': [u'Instrumental Bhajan'], 
  u'INITIALKEY': [u'C'],
  u'COPYRIGHT': [u'Radio'],
  u'ARTIST': [u'Radio],
  u'COMMENT:ITUNNORM': [u' 000003BF 000003BC 00002593 00002441 00032FE8 000337F8 00007D4C 00007F62 000189A8 000396F0'],
  u'BPM': [u'75'],
  u'COMMENT:ITUNSMPB': [u' 00000000 00000210 00000920 0000000000D4DCD0 00000000 00B14E00 00000000 00000000 00000000 00000000 00000000 00000000'],
  u'GENRE': [u'devotional, instrumental'], 
  u'TITLE': [u'Bhajare Ram Charan'], 
  u'ENCODING': [u'Logic Pro 9.1.8'], 
  u'DATE': [u'2015'],
  u'LABEL': [u'Radio]}

My code is very simple one:

Whose output is: Extracted Tags

{u'ALBUM': [u'Instrumental Bhajan'],
 u'INITIALKEY': [u'C'],
 u'COPYRIGHT': [u'Radio'], 
 u'ARTIST': [u'Radio'],
 u'COMMENT:ITUNNORM': [u' 000003BF 000003BC 00002593 00002441 00032FE8 000337F8 00007D4C 00007F62 000189A8 000396F0'],
 u'BPM': [u'75'], 
 u'COMMENT:ITUNSMPB': [u' 00000000 00000210 00000920 0000000000D4DCD0 00000000 00B14E00 00000000 00000000 00000000 00000000 00000000 00000000'],
 u'GENRE': [u'devotional, instrumental'], 
 u'TITLE': [u'Bhajare Ram Charan'],
 u'ENCODING': [u'Logic Pro 9.1.8'], 
 u'DATE': [u'2015'], 
 u'LABEL': [u'Radio']}

I am not able to find why these to keys are comming in not readable format?

import taglib
sosng = taglib.File("Bhajare-Ram-Charan-instrumental-bhajan-radio.mp3")
sosng.tags
Varun Singh
  • 444
  • 6
  • 21
  • 1
    The tag data comments look pretty readable to me: they are a bunch of hexadecimal numbers separated by spaces. iTunes uses `COMMENT:ITUNNORM` for gain control and `COMMENT:ITUNSMPB` for seamless playback. There is an official MP4 version of the SMPB tag but it is likely that only iTunes will understand the MP3 comments. – BoarGules Apr 02 '19 at 08:38
  • Okay , but how do I decode those two data? – Varun Singh Apr 02 '19 at 08:52
  • 1
    Since it is an internal iTunes configuration setting I doubt if anyone outside Apple can help you with that. Why is it so important to know what iTunes would do with the numbers? – BoarGules Apr 02 '19 at 08:53
  • Actually I need all the information that is embedded in an audio, These two keys are the only one I am not able make as readable. I am just curious how these two came in first place , so that I am able to understand and extract further – Varun Singh Apr 02 '19 at 08:59
  • 1
    iTunes put them there and software can put any tag it likes in an MP3 file for its own purposes if the name begins `COMMENT:`. It isn't information about the audio. It is information about how iTunes would play it back. – BoarGules Apr 02 '19 at 09:04
  • So you are suggesting that it is something iTunes is adding not actually by a user who is taging information in an audio? – Varun Singh Apr 02 '19 at 09:11
  • 1
    Yes. It is definitely being added by iTunes. See for example http://id3.org/iTunes%20Normalization%20settings for `COMMENT:ITUNNORM`. – BoarGules Apr 02 '19 at 09:17
  • This reference actually explains a lot brother. Thanks a lot. – Varun Singh Apr 02 '19 at 09:22
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/191087/discussion-between-varun-singh-and-boargules). – Varun Singh Apr 02 '19 at 11:09

1 Answers1

1

iTunes Seamless Playback: 8 bytes are for priming, that should be removed, 4 bytes trailing (remainder) that should be removed, next 8 bytes are for total samples (not including trailing samples and priming samples) and lastly 8 bytes are used for byte offset from the first audio frame to the 8th-from-last frame (resynchronization mechanism to restore a decoder's true sample number after a seek), 24 bytes are not used. Totally 52 bytes.

https://ffmpeg.org/pipermail/ffmpeg-devel/2012-July/127834.html

https://hydrogenaud.io/index.php?topic=48231.msg430949#msg430949

https://git.rockbox.org/cgit/rockbox.git/log/?qt=grep&q=gapless