Cannot read 6ch FLAC file
See original GitHub issuesf.read(r'D:\temp\6ch_silence.flac')
Out[6]: (array([], shape=(0, 6), dtype=float64), 16000)
sf.read(r'D:\temp\2ch_silence.flac')
Out[7]:
(array([[0., 0.],
[0., 0.],
[0., 0.],
...,
[0., 0.],
[0., 0.],
[0., 0.]]),
16000)
When I try to read 6ch flac file, soundfile returns empty array. 2ch is fine.
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Soundfile cannot read the full FLAC file it generated · Issue #236
I am generating a soundfile by appending to audioFile = sf.SoundFile(conf['pSavAudio'], mode='w', samplerate=samplerate, channels=nChan, subtype='PCM_16', ...
Read more >Problem converting 6ch 24-bit wav to FLAC - HydrogenAudio
I tried converting the WAVs into FLAC using winamp 5.52 (Flake 0.11). The resulting FLAC files however are only 16-bit (although it's proper...
Read more >How to Open, Edit, and Convert FLAC Files - Lifewire
What to Know. A FLAC file is an audio file in the Free Lossless Audio Codec format. Open one with VLC media player....
Read more >KB5003430: FLAC encoded music file is corrupted when ...
This update addresses a metadata encoding issue which causes Free Lossless Audio Codec (FLAC) music files to become unplayable if their title, artist, ......
Read more >Can't play 24bit/96kHz flac files - narkive
If I try to play them in MOC I get: (0) Can't set audio parameters: Invalid argument. With mplayer I see: MPlayer SVN-r30656...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, I investigated this a bit:
It seems that there is a limit on how many samples can be read from flac files at the moment. With your 2ch-example, the entire file is smaller than the limit, but with the 6ch-example is bigger. Reading in chunks of up to 2:45 minutes (or thereabouts) seems to work. More than that does not work.
This is most probably related to https://github.com/libsndfile/libsndfile/pull/858, and will therefore hopefully be fixed in the next release of libsndfile.
If you don’t think this is related, please open an issue at libsndfile. Silent files can be weird edge cases sometimes.
(By the way, if you urgently need a fix, put an updated libsndfile in your load path, and soundfile will use it instead of its own)