Skip to content

Import Error from Scipy Library 'kaiser' and asserting sampling_rate of audio wrongly  #434

@004Ajay

Description

@004Ajay

I was correcting some errors for another person, and I'm just a casual coder, not an expert. So pardon if I say something foolish.

I installed the package using pip install parallel-wavegan

Scipy Kaiser Import Error

Error:
ImportError: cannot import name 'kaiser' from 'scipy.signal'

From the file:
.../python3.10/site-packages/parallel_wavegan/layers/pqmf.py

  • I tried correcting your code locally, see the err-making code here, Line 11(import statement) and 45(function call)
  • Used the Scipy(1.14.1 stable) documentations see here and found three functions for kaiser: kaiser_atten(), kaiser_beta() and kaiserord()
  • I changed and saved the function name as kaiser_atten() and kaiserord(), and worked out to get the two outputs for both the functions.
  • Since I am not an expert in this, I wasn't able to differentiate the generated outputs of kaiser_atten() and kaiserord()

Sampling_rate Error

Error:
fs == config["sampling_rate"]
'audio.wav' seems to have a different sampling rate.

From the file:
.../python3.10/site-packages/parallel_wavegan/bin/preprocess.py

  • I think the error is in checking (fs == config["sampling_rate"])
  • So I changed == to != that is (fs != config["sampling_rate"])
  • See the err-making code here

Ending Notes:

  • I used these steps to run your code (from your main README)
  • Even though these small steps have avoided the error block for me. I would like the maintainer to check if these changes are valid and align with your logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions