librosa.load (audioread) breaks on this audio file, not sure why?
See original GitHub issueCalling librosa.load('101729.wav', sr=None)
(download file here) gives the following error:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-172-5d71d5777356> in <module>()
----> 1 audio, sr = librosa.load('101729.wav', sr=None)
/Users/justin/dev/miniconda3/envs/py27/lib/python2.7/site-packages/librosa/core/audio.pyc in load(path, sr, mono, offset, duration, dtype)
121 n = 0
122
--> 123 for frame in input_file:
124 frame = util.buf_to_float(frame, dtype=dtype)
125 n_prev = n
/Users/justin/dev/miniconda3/envs/py27/lib/python2.7/site-packages/audioread/rawread.pyc in read_data(self, block_samples)
110
111 # Make sure we have the desired bitdepth and endianness.
--> 112 data = audioop.lin2lin(data, old_width, TARGET_WIDTH)
113 if self._needs_byteswap and self._file.getcomptype() != 'sowt':
114 # Big-endian data. Swap endianness.
error: Size should be 1, 2 or 4
Must be something about the file’s format that causes the problem, though I’m not sure what. Here’s the file info (as returned by pysox):
{'bitrate': 24,
'channels': 2,
'duration': 84.580021,
'encoding': 'Signed Integer PCM',
'num_samples': 4059841,
'sample_rate': 48000.0,
'silent': False}
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (5 by maintainers)
Top Results From Across the Web
librosa.load — librosa 0.10.0.dev0 documentation
Load an audio file as a floating point time series. Audio will be automatically resampled to the given rate (default sr=22050 ). To...
Read more >Source code for librosa.core.audio
This is primarily useful for processing large files that won't fit entirely in memory at once. Instead of loading the entire audio signal...
Read more >Source code for librosa.core.audio
SoundFile, audioread object, or file-like object path to the input file. ... Instead of loading the entire audio signal into memory (as in...
Read more >Troubleshooting — librosa 0.10.0.dev0 documentation
If you're loading an audio file, and see the following message: UserWarning: PySoundFile failed. Trying audioread instead. Do not worry. This is a...
Read more >Advanced I/O Use Cases
Blockwise Reading¶. For large audio signals it could be beneficial to not load the whole audio file into memory. Librosa 0.7 introduced a...
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 FreeTop 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
Top GitHub Comments
@pratistha you mentioned
pyaudio
, but my solution was to usepysoundfile
(pip install pysoundfile
). Then loading the audio is just:Hope this helps!
To quote brmcfee, please refer to this thread https://groups.google.com/d/topic/librosa/Z1-HXBsHLi0/discussion.
DAn.
On Wed, Jul 12, 2017 at 3:53 AM, Khalidhussain1134 <notifications@github.com