When you call a method in GDScript (here set_pitch_scale
), it will look at the type of the object, and see if the method can be found. If it's not there, then it will look for the parent class. If it's still not there, it will look for the grand-parent etc until the top-most class of the inheritance hierarchy is reached.
In your case, you tried to call set_pitch_scale
on an object that didn't have this function, and whose top-most class is GDNativeClass
, which obviously doesn't have it either.
Make sure the object you call this on is a SamplePlayer. Either by inheriting it, or by getting a reference to it so you can call it from somewhere else, like this:
var sample_player = get_node("relative/path/to/sampleplayer")
sample_player.set_pitch_scale(voice, pitch)
GDNativeClass
probably means you tried to call this on an object whose class is defined in GDScript. If you mind showing your code we can eventually tell you more about it.