Trigger Word Detection: Insert Audio Clip


My assignment Trigger Word Detection get stuck in the function ‘insert_audio_clip’. Any tips how to solve this?

It should be impossible for your code to get stuck, because the only loop is a while-statement, which should include a retry counter that limits the number of iterations.

It should… but

while is_overlapping(segment_time, previous_segments) :
segment_time = get_random_time_segment(segment_ms)

the tests for is_overlapping are passing… but if I run all cells, executing halts here…

The unit test for is_overlapping() is not robust. It does not detect many potential errors.

1 Like

And your while-loop should have a check for the maximum number of retries.
The template code for the while-loop looked like this:

while None and retry >= 0:

Apparently you deleted the test for the retry count.

1 Like