Just getting into the Trigger Word Detection project. I looked on here for any post about this assignment so I figured I would start a post about it before i start googling and running down rabbit holes when I am just over-complicating it.
For the first function we have to fill in
Insert Audio clip
I am unsure about the first block of code we fill in:
START CODE HERE
# Step 1: Use one of the helper functions to pick a random time segment onto which to insert
# the new audio clip. (≈ 1 line)
segment_time = None
# 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)
retry = 5 # @KEEP
while None and retry >= 0:
segment_time = None
retry = retry - 1
What helper do we use to get the initial setting of
segment_time
I want to use
get_random_time_segment, but when i pass in either one of the parameters i get errors both ways. I know my issue is how i am setting the
segment_time
variable. But i am completely unsure of what to do with the while loop. Do i just do
while segment_time = None and retries >= 0:
or does something else go into the “None” spot in the while loop.
I hope with that info I will be able to get through the start, but like i said, i am not sure of myself, and I wanted to start a thread for this project before i start searching forums.
This is the error is this:
AssertionError: The segment length must match the audio clip length
After my while statement i print the 'segment_time" and get this:
(3046, 3961)
but the output of my function it goes into the else block which is why it is returning the wrong length.
(<pydub.audio_segment.AudioSegment at 0x7f381644b250>, (10000, 10000))
So there is overlap i assume in my time segments leading me back to the while loop.