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

File not opening in Colab #9

Open
mhmd-mst opened this issue Aug 29, 2023 · 0 comments
Open

File not opening in Colab #9

mhmd-mst opened this issue Aug 29, 2023 · 0 comments

Comments

@mhmd-mst
Copy link

I am working in colab, I tried to upload an mp3 file and a WAV file and I got in the mp3 file:
LibsndfileError Traceback (most recent call last)
in <cell line: 4>()
5 print('Denoising uploaded file "{name}"'.format(
6 name=fn))
----> 7 denoise_data=denoise_audio(fn)
8 basename=os.path.splitext(fn)[0]
9 wav_output_name=basename+"_denoised"+".wav"

3 frames
in denoise_audio(audio)
69 def denoise_audio(audio):
70
---> 71 data, samplerate = sf.read(audio)
72 print(data.dtype)
73 #Stereo to mono

/usr/local/lib/python3.10/dist-packages/soundfile.py in read(file, frames, start, stop, dtype, always_2d, fill_value, out, samplerate, channels, format, subtype, endian, closefd)
283
284 """
--> 285 with SoundFile(file, 'r', samplerate, channels,
286 subtype, endian, format, closefd) as f:
287 frames = f._prepare_read(start, stop, frames)

/usr/local/lib/python3.10/dist-packages/soundfile.py in init(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
656 self._info = _create_info_struct(file, mode, samplerate, channels,
657 format, subtype, endian)
--> 658 self._file = self._open(file, mode_int, closefd)
659 if set(mode).issuperset('r+') and self.seekable():
660 # Move write position to 0 (like in Python file objects)

/usr/local/lib/python3.10/dist-packages/soundfile.py in _open(self, file, mode_int, closefd)
1214 # get the actual error code
1215 err = _snd.sf_error(file_ptr)
-> 1216 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1217 if mode_int == _snd.SFM_WRITE:
and in the WAV another file related to file not being opened,
I am just tunning the cells as they are.

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

1 participant