Spoken-language-identification icon indicating copy to clipboard operation
Spoken-language-identification copied to clipboard

code error in create_spectrograms.py

Open rainskyfyy opened this issue 8 months ago • 0 comments

your code at line 44 in create_spectrograms.py is probably wrong, which is:

scale = np.array(map(lambda x: x * alpha if x <= f0 else (fmax-alpha*f0)/(fmax-f0)*(x-f0)+alpha*f0, scale))

cause the map function returns an iterator, not an array. I change it to this:

scale = np.where(scale <= f0, scale * alpha, (fmax-alpha*f0)/(fmax-f0)*(scale-f0)+alpha*f0)

and it works.

rainskyfyy avatar Jun 07 '24 07:06 rainskyfyy