- 
                Notifications
    
You must be signed in to change notification settings  - Fork 309
 
Open
Description
def get_board(semitones: float):
    semitones = round(semitones, 1)
    if board := board_mapping.get(semitones):
        return board
    board = Pedalboard([
        PitchShift(semitones=semitones),
        Reverb(room_size=0.4, wet_level=0.3)
    ])
    board_mapping[semitones] = board
    return board
def _change_pitch(chunk: bytes) -> bytes:
    if not (ConfigApi.config.filter_enable and ConfigApi.config.pitch_offset_enable):
        return chunk
    samples = np.frombuffer(chunk, dtype=np.int16).astype(np.float32) / 32768.0
    offset = round((ConfigApi.config.pitch_offset - 500) / 100, 1)
    board = get_board(offset)
    processed = board(samples, RATE, len(samples), reset=False)
    out = (processed * 32767.0).astype(np.int16).tobytes()
    return out
I confirm my params is vailed,if the reset param set True,it's worked, but if reset is False,it's doesn't work.
output array is [0, 0, 0, ...], conver to bytes is \x00\x00\x00\x00...    please help me
Metadata
Metadata
Assignees
Labels
No labels