C5_W3_A3_Trigger word Dectection

In function is_overlapping, the starter code has a break statement which makes code a bit fast. I don’t understand why you’ve removed it.

In function insert_audio_clip, retry isn’t taken into account when looking for a non-overlapping random time segment.

Also, the function is modified at places where it’s not required.

Here’s the comment in the starter code:

    # Step 2: Check if the new segment_time overlaps with one of the previous_segments. If so, keep 
    # picking new segment_time at random until it doesn't overlap. To avoid an endless loop
    # we retry 5 times(≈ 2 lines)

This is your version:

    # Step 2: Check if the new segment_time overlaps with one of the previous_segments. If so, keep 
    # picking new segment_time at random until it doesn't overlap. (≈ 2 lines)

Please follow these steps to refresh your workspace and do it again with the corrections.

2 Likes