Comments (6)
I'm seeing what looks like 2X with an mp3 on this code path:
if frames == 0 and ID3._USE_XING_HEADER:
mp3 generated by lame, for a 48k ABR mp3. When I encode at 96k ABR, it's not off by
a factor of 2. So it appears to be bit rate, not channels, which throws off the interpretation
of the xing header. My wife's a musician, I can encode one of her tracks (no license issues)
if you need some example mp3's.
from tinytag.
In any case, in _parse_xing_header() the TOC values are bytes, not 4-byte big endian values.
But that doesn't change the duration calculation...
from tinytag.
Wowzeee, It now takes me a year to answer github issues 😢
Anyway, if you still have any of the files at hand, please post them, so this issue can be reproduced!
from tinytag.
Sure... compare soxi on https://vsta.org/andy/pickup/qz9k29290006-48.mp3 versus what tinytag says for duration. (It's my wife's track, so copyright/music licensing is no problem, enjoy!)
BTW, welcome back.
from tinytag.
Hey @vandys , thanks for the sample file. That and your comment about an off by a factor of 2 lead me to some investigation about the mp3 format. It turns out that the mp3 frames have 1152 samples per channel. My test for the xing header was using a mono-channel file, so your stereo file was off by a factor of 2 🤦
Anyway I have fixed the issue an your file is now correctly read. I am using a truncated version of your file for the test-suite now.
Thanks for your hints and your patience! You can use the version here in git until the next version is released containing this fix.
Have a great day in these weird times, maybe you'd fancy some cake? here you go: 🥮
from tinytag.
Thanks much!
from tinytag.
Related Issues (20)
- Feature Request: Adding Song Titles HOT 2
- [BUG] AIFF text should be treated as UTF-8 HOT 2
- [BUG] Incorrect bitrate and duration for VBR mp3s HOT 5
- [BUG] UnicodeDecodeError on valid MP3 file
- Make use of code linting HOT 1
- How to handle filebuffer instead of filenames
- [BUG] Some mp3 files report 1/2 of actual duration HOT 2
- Some MP3‘s genre cannot be read correctly since v1.8.0
- [Question] - detect image encoding / format HOT 1
- tag artist, quando adicionado mais de um artista a string fica mal formatada. HOT 1
- [BUG] struct.error: unpack requires a buffer of 4 bytes HOT 8
- [BUG] Parsing mp3 file w/ valid TDRC tag does not populate year HOT 4
- Replace deprecated aifc module HOT 3
- [BUG] TDRC tag not captured as "year" HOT 2
- [BUG] Can't read `extra` tags from .m4a files HOT 1
- Expose a list of supported file extensions HOT 4
- Fail to read track_total, but it is ok in foobar
- asyncio interfaces HOT 3
- [BUG] Incompatibility with Python-pip HOT 2
- [BUG] `tags.year` is null although the MP3 file has the year set HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinytag.