-
-
Notifications
You must be signed in to change notification settings - Fork 223
Can't extend AudioStreamGeneratorPlayback #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good catch, thanks for reporting! Maybe a bit of background, we generate the entire Godot API (everything in To my knowledge, there is no property that allows us to reliably identify whether a class is inheritable (there is an Are you aware of other such classes? |
I am aware that the API is generated and I'm aware that I'm venturing into the more rarely used areas of the API surface, so I'm not too surprised to be encountering issues like this. Totally understood :-). I'm not aware of any other classes that have this problem but I'll report them if I find them. Thanks! |
For the benefit of anyone reading this, I should have been extending The rest of the bug report is correct though :-). |
The following classes also have this problem:
It seems Godot doesn't allow extending any of these classes. In all cases attempting to do so gives an error similar to: ERROR: Extension class 'Investigate1136Playback' cannot extend native abstract class 'AudioStreamPlaybackSynchronized'. |
Note that this means it is illegal to extend any I think it might be a bug in Godot that it is legal to extend |
godot-rust version: 0.2.4
Consider this minimal class extending
AudioStreamGeneratorPlayback
:When this code is loaded into Godot, Godot reports:
My understanding is that it's not supposed to be possible to extend this class, but I may be mistaken. In this case, the above code should be a compile error in godot-rust.
Even if it is supposed to be possible to extend
AudioStreamGeneratorPlayback
,IAudioStreamGeneratorPlayback
appears to be incorrect. To implement this trait the programmer must implement themix_resampled
andmix
functions, but both of these have default implementations in Godot.It's especially illogical to require the programmer to implement
mix
because the whole point of extendingAudioStreamGeneratorPlayback
(as opposed toAudioStreamPlayback
) is thatmix
callsmix_resampled
and resamples the audio for you.I'm compiling this code with the
experimental-threads
feature enabled because if this code were working,mix
would be called by Godot from a non-main thread. However as a matter of practice Godot never gets as far as calling this function, soexperimental-threads
is not strictly required to reproduce the above error.I would like to use
AudioStreamGeneratorPlayback
in my project but as a workaround I am implementingAudioStreamPlayback
instead and providing my own implementation of resampling.The text was updated successfully, but these errors were encountered: