You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/hugo/descript/vampnet-v0/scripts/utils/split_long_audio_file.py", line 31, in <module>
split_long_audio_file()
File "/home/hugo/miniconda3/envs/vampnet/lib/python3.9/site-packages/argbind/argbind.py", line 159, in cmd_func
return func(*cmd_args, **kwargs)
File "/home/hugo/descript/vampnet-v0/scripts/utils/split_long_audio_file.py", line 20, in split_long_audio_file
for sig in tqdm.tqdm(sig.windows(window_duration=max_chunk_size_s, hop_duration=max_chunk_size_s/2, preprocess=False)):
File "/home/hugo/miniconda3/envs/vampnet/lib/python3.9/site-packages/tqdm/std.py", line 1182, in __iter__
for obj in iterable:
File "/home/hugo/miniconda3/envs/vampnet/lib/python3.9/site-packages/audiotools/core/dsp.py", line 61, in windows
start_idx = i * hop_length
UnboundLocalError: local variable 'hop_length' referenced before assignment
here's a script to repro:
from pathlib import Path
import argbind
import audiotools as at
import tqdm
@argbind.bind(without_prefix=True)
def split_long_audio_file(
file: str = None,
max_chunk_size_s: int = 60*10
):
file = Path(file)
output_dir = file.parent / file.stem
output_dir.mkdir()
sig = at.AudioSignal(file)
# split into chunks
for i, sig in tqdm.tqdm(enumerate(sig.windows(
window_duration=max_chunk_size_s, hop_duration=max_chunk_size_s/2,
preprocess=True))
):
sig.write(output_dir / f"{i}.wav")
print(f"wrote {len(list(output_dir.glob('*.wav')))} files to {output_dir}")
return output_dir
if __name__ == "__main__":
args = argbind.parse_args()
with argbind.scope(args):
split_long_audio_file()
The text was updated successfully, but these errors were encountered:
here's a script to repro:
The text was updated successfully, but these errors were encountered: