(body, speed=1)
return rv
Change the voice speed of the wave body.
Change the voice speed of the wave body.
Change the voice speed of the wave body .
def change_speed(body, speed=1):
    """Change the voice speed of the wave body."""
    if speed == 1:
        return body

    length = int(len(body) * speed)
    rv = bytearray(length)

    step = 0
    for v in body:
        i = int(step)
        while i < int(step + speed) and i < length:
            rv[i] = v
            i += 1
        step += speed
    return rv
def change_speed ( body , speed = 1 ) : if speed == 1 : return body length = int ( len ( body ) * speed ) rv = bytearray ( length ) step = 0 for v in body : i = int ( step ) while i < int ( step + speed ) and i < length : rv [ i ] = v i += 1 step += speed return rv