Rene Maurer
unread,Apr 21, 2017, 1:48:53 AM4/21/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to quod-libet-...@googlegroups.com
Hello
I am a little bit confused about the StreamInfo class. Maybe someone
can help me out.
I have....
# soxi 01_donato_lagos_que_sera_vals_1938.flac
Input File : '01_donato_lagos_que_sera_vals_1938.flac'
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:02:26.01 = 6438945 samples = 10950.6 CDDA sectors
File Size : 6.88M
Bit Rate : 377k
Sample Encoding: 16-bit FLAC
# metaflac --show-sample-rate --show-channels --show-bps \
01_donato_lagos_que_sera_vals_1938.flac
44100
2
16
....and I try to get the same information with mutagen:
python2#
>>> import mutragen
>>> mutagen.version
>>> (1, 37)
>>> from mutagen.flac import StreamInfo
>>> info.sample_rate
>>> 443926
>>> info.channels
>>> 4
>>> info.bits_per_sample
>>> 23
Even more strange for me is the following:
>>> import shutil
>>> shutil.copy("01_donato_lagos_que_sera_vals_1938.flac", "x.flac")
>>> info2 = StreamInfo("x.flac")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 109, in
__init__ self.load(data)
File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 212, in
load self.min_framesize = int(to_int_be(data.read(3)))
File "/usr/lib/python2.7/site-packages/mutagen/flac.py", line 70, in
read size, len(data)))
mutagen.flac.error: file said 3 bytes, read 2 bytes
Any hints?
Best regards
René