Skip to content

Commit 43c457e

Browse files
authored
Merge pull request #230 from HaHeho/master
add display sound file length in samples
2 parents c4ca092 + 081776c commit 43c457e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

soundfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ def _duration_str(self):
402402
duration = "{0:.0g}:{1:02.0g}:{2:05.3f} h".format(hours, minutes, seconds)
403403
elif minutes >= 1:
404404
duration = "{0:02.0g}:{1:05.3f} min".format(minutes, seconds)
405+
elif seconds <= 1:
406+
duration = "{0:d} samples".format(self.frames)
405407
else:
406408
duration = "{0:.3f} s".format(seconds)
407409
return duration

0 commit comments

Comments
 (0)