Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when processing audios wav and flac audios #4

Open
FirestName opened this issue Nov 20, 2023 · 3 comments
Open

Error when processing audios wav and flac audios #4

FirestName opened this issue Nov 20, 2023 · 3 comments

Comments

@FirestName
Copy link

Hello, tried to augment my dataset with --split_stereo flag. however, after some fine running I get the following error:

"Traceback (most recent call last):
File "/content/augment.py", line 95, in
process_audio_file(input_file, args.output_folder, args.chunk_duration, args.split_stereo, args.add_silence, args.speed_change)
File "/content/augment.py", line 26, in process_audio_file
audio, sample_rate = sf.read(input_file)
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 288, in read
data = f.read(frames, dtype, always_2d, fill_value, out)
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 895, in read
frames = self._array_io('read', out, frames)
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 1344, in _array_io
return self._cdata_io(action, cdata, ctype, frames)
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 1356, in _cdata_io
self.seek(curr + frames, SEEK_SET) # Update read & write position
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 802, in seek
_error_check(self._errorcode)
File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 1407, in _error_check
raise LibsndfileError(err, prefix=prefix)
soundfile.LibsndfileError: Internal psf_fseek() failed."

The files are wav and flac, 44100hz and should be 16 bit, however some might be 24 bit.

I have previously ran this script with no problems, but not with this dataset.

@materialvision
Copy link
Owner

Hi, it seems to be some file in the dataset that causes it, hard to say. I can only suggest you try to find the "bad" file and remove it. Maybe split the dataset into smaller folders and run little by little.

@FirestName
Copy link
Author

FirestName commented Nov 20, 2023

Ok, I've located the "bad" files. Curious though, as those do not differ from the rest.
The bad files are .flac, but there's other flacs that cause no ruckus.

@FirestName
Copy link
Author

converted the bad files .wav and ran the script succesfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants