gammatone icon indicating copy to clipboard operation
gammatone copied to clipboard

TypeError: super() takes at least 1 argument (0 given)

Open sivagnanamn opened this issue 8 years ago • 2 comments

I cloned the gammatone repo and tried "python -m gammatone -a FurElise.wav -d 20". I'm getting 'TypeError: super() takes at least 1 argument (0 given)' error. Below is the stacktrace

  File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "G:\Experiments\Godrej\gammatone-master\gammatone-master\gammatone\__main__.py", line 6, in <module>
    main()
  File "gammatone\plot.py", line 169, in main
    return render_audio_from_file(args.sound_file, args.duration, args.function)
  File "gammatone\plot.py", line 134, in render_audio_from_file
    twin, thop, channels, fmin)
  File "gammatone\plot.py", line 80, in gtgram_plot
    formatter = ERBFormatter(f_min, fs/2, unit='Hz', places=0)
  File "gammatone\plot.py", line 48, in __init__
    super().__init__(*args, **kwargs)
TypeError: super() takes at least 1 argument (0 given)

sivagnanamn avatar Apr 05 '16 06:04 sivagnanamn

It looks like either an incompatibility with recent matplotlib, or I've introduced a dependency on Python 3 without realising. I'll look into it.

detly avatar Apr 05 '16 06:04 detly

from matplotlib.ticker import EngFormatter
formatter = EngFormatter(unit='Hz', places=0)

img = axes.imshow(Z, extent=[0, duration, f_min, fs/2], aspect="auto")

I made these changes in plot.py and it worked for me.

sivagnanamn avatar Apr 06 '16 11:04 sivagnanamn