You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation doesn't mention that load_from_buffer and load_from_file don't exist in the C# version of Godot. In order to load from a file, I have to use ResourceLoader.Load to load the audio files.
URL to the documentation page (if already existing):
/// <summary>
/// <para>Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain Ogg Vorbis data.</para>
/// </summary>
public static AudioStreamOggVorbis LoadFromBuffer(byte[] buffer)
{
return (AudioStreamOggVorbis)NativeCalls.godot_icall_1_188(MethodBind0, buffer);
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private static readonly IntPtr MethodBind1 = ClassDB_get_method_with_compatibility(NativeName, MethodName.LoadFromFile, 797568536ul);
/// <summary>
/// <para>Creates a new AudioStreamOggVorbis instance from the given file path. The file must be in Ogg Vorbis format.</para>
/// </summary>
public static AudioStreamOggVorbis LoadFromFile(string path)
{
return (AudioStreamOggVorbis)NativeCalls.godot_icall_1_189(MethodBind1, path);
}
Two things you might have missed:
C# methods and properties are generally in PascalCase rather than snake_case. The online class reference currently does not mention this directly or provide a C# version of each method directly, but in most cases you can mentally convert between the two casing conventions. The exceptions are listed here: https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_differences.html. There are vague plans to create a more dedicated C# class reference, because this really isn't ideal.
These are static functions, so you use them with the class itself rather than an instance of the class.
Your Godot version:
Godot 4.3
Issue description:
The documentation doesn't mention that
load_from_buffer
andload_from_file
don't exist in the C# version of Godot. In order to load from a file, I have to use ResourceLoader.Load to load the audio files.URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_audiostreamoggvorbis.html#class-audiostreamoggvorbis-method-load-from-file
The text was updated successfully, but these errors were encountered: