[Bug?] Using multiple frequency ranges - last example provided throws errors on certain .wav files
ricardofeynman opened this issue · 3 comments
LOVE this. Thank you for upping the game!
I've been using this repo's multi-freq example workflow on shorter 3 sec .wav clips without issue, and the larger 30 sec .wav clip I'm using threw no errors when using your civitai audio reactive workflow example.
However when I try to use the 30 sec clip in the multi-freq example, the following errors are thrown, regarding the second (of four in Positive Strengths) "Normalize Amplitude To Float or Int" node:
Error occurred when executing NormalizedAmplitudeToNumber:
Cannot convert non-finite values (NA or inf) to integer
File "/home/x/Desktop/ComfyUI_2023-11-15_1692C/ComfyUI/execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/x/Desktop/ComfyUI_2023-11-15_1692C/ComfyUI/execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/home/x/Desktop/ComfyUI_2023-11-15_1692C/ComfyUI/execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/x/Desktop/ComfyUI_2023-11-15_1692C/ComfyUI/custom_nodes/ComfyUI-AudioScheduler/nodes.py", line 391, in convert
return (normalized_amp, normalized_amp.astype(int))
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/generic.py", line 6534, in astype
new_data = self._mgr.astype(dtype=dtype, copy=copy, errors=errors)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 414, in astype
return self.apply(
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 354, in apply
applied = getattr(b, f)(**kwargs)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/internals/blocks.py", line 616, in astype
new_values = astype_array_safe(values, dtype, copy=copy, errors=errors)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 238, in astype_array_safe
new_values = astype_array(values, dtype, copy=copy)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 183, in astype_array
values = _astype_nansafe(values, dtype, copy=copy)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 101, in _astype_nansafe
return _astype_float_to_int_nansafe(arr, dtype, copy)
File "/home/x/.local/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 146, in _astype_float_to_int_nansafe
raise IntCastingNaNError(
Any idea why this might be happening? All my audio clips were exported from Audacity with standard .wav export settings (converted from a .flac I didn't create), if that helps at all.
Edit: Update - I've tried with newly created 30 sec .wav samples, and no other errors thrown so far.
Looks like it was happening in the normalization node. I wonder if there was a divide by zero at some point and that wouldn't work. thank you for reporting this issue. Will look into it more later.
Fix should be up for this
Thanks, can confirm no errors thrown when using the same .wav that brought the issue to my attention.
Was planning to post a feature request when I have a little more time next week, but I can already see the benefit of having an option for more granular subdivisions on the graph images, both for Amplitude and Frame(s).
0.05 Amplitude and 5 Frame(s) increments denoted would be a great help.