From 289bc208617b3e5f3e108d0705459da809518341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E9=9C=87=E4=B8=9C?= Date: Wed, 4 Dec 2024 11:39:06 +0800 Subject: [PATCH] fix precision problem of silent --- pydub/audio_segment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydub/audio_segment.py b/pydub/audio_segment.py index 3b9e2881..d0fededa 100644 --- a/pydub/audio_segment.py +++ b/pydub/audio_segment.py @@ -464,7 +464,7 @@ def silent(cls, duration=1000, frame_rate=11025): Generate a silent audio segment. duration specified in milliseconds (default duration: 1000ms, default frame_rate: 11025). """ - frames = int(frame_rate * (duration / 1000.0)) + frames = int(frame_rate * duration / 1000.0) data = b"\0\0" * frames return cls(data, metadata={"channels": 1, "sample_width": 2,