I have a MP3 encoded stereo file of the following length:
>>> audiofile.duration(path)
3.996734693877551
Reading in the full file works:
>>> audiofile.read(path)
[[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]] 44100
Also reading with an offset of 3 seconds works:
>>> audiofile.read(path, offset=3.0,)
[[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]] 44100
But when I try to read with an offset greater than the file duration it hangs instead of returning an empty array.
I tested with a WAV file and there it worked. So it seems to be related to reading encoded files with sox:
I have a MP3 encoded stereo file of the following length:
Reading in the full file works:
Also reading with an offset of 3 seconds works:
But when I try to read with an offset greater than the file duration it hangs instead of returning an empty array.
I tested with a WAV file and there it worked. So it seems to be related to reading encoded files with
sox: