spotify / pedalboard

🎛 🔊 A Python library for audio.

Home Page:https://spotify.github.io/pedalboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incompatible function argument in tensorflow

xinzuan opened this issue · comments

hi, i try to do a simple augmentation using reverb. however it raised following error:

    1. (self: pedalboard_native.Plugin, input_array: numpy.ndarray, sample_rate: float, buffer_size: int = 8192, reset: bool = True) -> numpy.ndarray[numpy.float32]
    
Invoked with: <Pedalboard with 1 plugin: [<pedalboard.Reverb room_size=0.5 damping=0.5 wet_level=0.33 dry_level=0.4 width=1 freeze_mode=0 at 0x55950b6924f0>]>; kwargs: samples=array([[0.0050354 , 0.01470947, 0.02227783, ..., 0.06311035, 0.06674194,
        0.06939697]], dtype=float32), sample_rate=22050.0, buffer_size=8192, reset=True

I am not quite sure why it happen. I have make sure that the samples is numpy.ndarray but it keeps showing this error.

Here how i use the function:

augment = Pedalboard([Reverb()])
audio = augment(samples=audio.numpy(), sample_rate=float(sr))

Thanks

Hi @xinzuan,

The error message you've pasted says that you're passing an argument called samples, but the method signature you're calling does not contain a samples argument. Just do:

audio = augment(audio.numpy(), sample_rate=sr)