“e983cc90fcee4e5b73bce9d4853b85aac4661e3a”上不存在“python/paddle/nn/functional/rnn.py”
提交 d8348e24 编写于 作者: X Xinghai Sun

Fix a missing abs bug for DS2 AudioSegment.

上级 1920b771
...@@ -378,7 +378,7 @@ class AudioSegment(object): ...@@ -378,7 +378,7 @@ class AudioSegment(object):
:type shift_ms: float :type shift_ms: float
:raises ValueError: If shift_ms is longer than audio duration. :raises ValueError: If shift_ms is longer than audio duration.
""" """
if shift_ms / 1000.0 > self.duration: if abs(shift_ms) / 1000.0 > self.duration:
raise ValueError("Absolute value of shift_ms should be smaller " raise ValueError("Absolute value of shift_ms should be smaller "
"than audio duration.") "than audio duration.")
shift_samples = int(shift_ms * self._sample_rate / 1000) shift_samples = int(shift_ms * self._sample_rate / 1000)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册