5

I am trying to load a file which is a midi file. A simple loading is giving me the following error. My librosa version is 0.6.3 and Python is 3.6.8.

I have ffmpeg already in my Ubuntu. I saw a similar issue for windows where they asked to check and restart Pycharm and it seemed to work for them.

import librosa
from argparse import ArgumentParser

parser= ArgumentParser(description="File loader")
req_args=parser.add_argument_group('Args needed')
parser.add_argument('-f','--filename',required=True)

args=parser.parse_args()
file=args.filename

y,sr=librosa.core.load(file)
print ("Sampling rate is {}".format(sr))
librosa.output.write_wav('output.wav',y,sr)
y,sr=librosa.core.load(file)
  File "/home/pathfinder/.local/lib/python3.6/site-packages/librosa/core/audio.py", line 119, in load
    with audioread.audio_open(os.path.realpath(path)) as input_file:
  File "/home/pathfinder/.local/lib/python3.6/site-packages/audioread/__init__.py", line 116, in audio_open
    raise NoBackendError()
audioread.exceptions.NoBackendError
Teja8484
  • 69
  • 2
  • 10
  • are you using pycharm? – Kenan Dec 12 '20 at 21:14
  • For some reason loading midi files didn't work on my PC either, if you just want to load a single file what I'd recommend is converting the file to .wav file online or using a python program then use librosa to load file. – Jith Z Jun 27 '21 at 12:26

0 Answers0