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

AttributeError: module 'librosa' has no attribute 'output' #4

Open
ropinheiro opened this issue Jul 30, 2020 · 7 comments
Open

AttributeError: module 'librosa' has no attribute 'output' #4

ropinheiro opened this issue Jul 30, 2020 · 7 comments

Comments

@ropinheiro
Copy link

When I run this command:

python3 recognize.py -video Flow.mp4

It apparently works until this part, where an error occurs:

(...)
video duration, hours: 0.6886200050390526
Traceback (most recent call last):
  File "recognize.py", line 55, in <module>
    split_into_frames('current.wav')
  File "recognize.py", line 49, in split_into_frames
    librosa.output.write_wav('samples/{}.wav'.format(chr(int(i/50)+65)), tmp_batch, sr)
AttributeError: module 'librosa' has no attribute 'output'

A current.wav is generated, but no subtitles file appears.

@Mladia
Copy link

Mladia commented Sep 12, 2020

librosa does not support output anymore
from librosa changelogs:
#917 The output module is now deprecated, and will be removed in version 0.8.

@Sadam1195
Copy link

Sadam1195 commented Apr 1, 2021

you can substitute

librosa.output.write_wav('samples/{}.wav'.format(chr(int(i/50)+65)), tmp_batch, sr)

with

import soundfile as sf
sf.write('samples/{}.wav'.format(chr(int(i/50)+65)), tmp_batch, sr)

in your code.

@ropinheiro

@Sangramsingkayte
Copy link

(Speech) Sangram:resample sing$ python resample.py
Traceback (most recent call last):
File "resample.py", line 8, in
librosa.output.write_wav(newFilename, y_16, 16000)
AttributeError: module 'librosa' has no attribute 'output'

@Sadam1195
Copy link

Sadam1195 commented May 25, 2021

(Speech) Sangram:resample sing$ python resample.py
Traceback (most recent call last):
File "resample.py", line 8, in
librosa.output.write_wav(newFilename, y_16, 16000)
AttributeError: module 'librosa' has no attribute 'output'

Please edit the code in resample.py with the comments in #4 (comment)
@Sangramsingkayte

@carlosmatthews
Copy link

carlosmatthews commented May 25, 2021

Hy , I edit the code in resample.py with the comments in #4 (comment).

sf.write('samples/{}.wav'.format(chr(int(i/50)+65)), tmp_batch, sr)`

but I get an error with the new library (soundfile)

File "C:\Python38\lib\site-packages\soundfile.py", line 1357, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'samples/A.wav': System error.

@Sadam1195

@Sadam1195
Copy link

Hy , I edit the code in resample.py with the comments in #4 (comment).

sf.write('samples/{}.wav'.format(chr(int(i/50)+65)), tmp_batch, sr)`

but I get an error with the new library (soundfile)

File "C:\Python38\lib\site-packages\soundfile.py", line 1357, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'samples/A.wav': System error.

Error indicates that you do not have samples folder in that directory. Please create samples folder manually and rerun the code.

@carlosmatthews

@carlosmatthews
Copy link

thanks, @Sadam1195 , Thank you very much I did not find the problem

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

5 participants