From 18c5d6393489c713959a69f8ce23cc7199acc182 Mon Sep 17 00:00:00 2001 From: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com> Date: Sat, 7 Feb 2026 02:32:37 +0530 Subject: [PATCH] Fix torchaudio.load() Path compatibility issue Convert Path object to string before passing to torchaudio.load() to fix compatibility with torchaudio backends that expect string paths. Fixes RuntimeError: "Expected a value of type 'str' for argument '0' but instead found type 'PosixPath'" Fixes #92 --- encodec/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encodec/__main__.py b/encodec/__main__.py index 343ac9f..2840602 100644 --- a/encodec/__main__.py +++ b/encodec/__main__.py @@ -106,7 +106,7 @@ def main(): fatal(f"Bandwidth {args.bandwidth} is not supported by the model {model_name}") model.set_target_bandwidth(args.bandwidth) - wav, sr = torchaudio.load(args.input) + wav, sr = torchaudio.load(str(args.input)) wav = convert_audio(wav, sr, model.sample_rate, model.channels) compressed = compress(model, wav, use_lm=args.lm) if args.output.suffix.lower() == SUFFIX: