Unverified Commit bcd23a54 authored by Yoach Lacombe's avatar Yoach Lacombe Committed by GitHub
Browse files

Avoid edge case in audio utils (#28836)

parent 7941769e
...@@ -412,6 +412,12 @@ def spectrogram( ...@@ -412,6 +412,12 @@ def spectrogram(
if np.iscomplexobj(waveform): if np.iscomplexobj(waveform):
raise ValueError("Complex-valued input waveforms are not currently supported") raise ValueError("Complex-valued input waveforms are not currently supported")
if power is None and mel_filters is not None:
raise ValueError(
"You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram."
"Specify `power` to fix this issue."
)
# center pad the waveform # center pad the waveform
if center: if center:
padding = [(int(frame_length // 2), int(frame_length // 2))] padding = [(int(frame_length // 2), int(frame_length // 2))]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment