For real I'm just confused, as I had a confusing bug and it turned out it was because len(audio_segment) returned milliseconds for some reason.
Okay after reviewing the your code... sigh I guess It make sense, but at least make a function that returns it in seconds and not "advertise" this inconsistency in your docs 😭