Skip to content

Commit 1880b01

Browse files
committed
Add codec and format info
1 parent 2b7a5c5 commit 1880b01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

benchmarks/decoders/benchmark_audio_decoders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ def decode_with_torchaudio_load(path: Path, backend: str) -> None:
9797
args = parser.parse_args()
9898
path = Path(args.path)
9999

100+
metadata = AudioDecoder(path).metadata
101+
duration = str(timedelta(seconds=metadata.duration_seconds_from_header)).split(".")[0]
100102

101103
print(
102-
f"Benchmarking {path.name}, duration: {get_duration(path)}, averaging over {args.num_exp} runs:"
104+
f"Benchmarking {path.name}, duration: {duration}, codec: {metadata.codec}, format: {metadata.sample_format}, averaging over {args.num_exp} runs:"
103105
)
104106

105107
for decode_f, kwargs, prefix in (

0 commit comments

Comments
 (0)