Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a7e88e

Browse files
samples(python): guard against invalid STFT time step
1 parentc5d70a7 commit9a7e88e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎samples/python/audio_spectrogram.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@ def STFT(self, inputAudio):
330330
"""
331331

332332
time_step=self.windLen-self.overlap
333+
iftime_step<=0:
334+
raiseValueError(
335+
"Invalid STFT parameters: overlap must be smaller than window length"
336+
)
333337
stft= []
334338

335339
ifself.windowType=="Hann":
@@ -801,4 +805,4 @@ def initAndCheckArgs(self, args):
801805

802806
args=parser.parse_args()
803807

804-
AudioDrawing(args).Draw()
808+
AudioDrawing(args).Draw()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp