godotengine / godotengine/godot-docs
Custom AudioStreams documentation code snippets out-of-date & don't compile
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
Godot Version 4.2
The documentation for [Custom AudioStreams](https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_audiostreams.html) has code snippets that are out of date and don't compile when used in a project. Several functions have been renamed or updated with new signatures, and a few methods have been removed entirely.
to name a few...
AudioStreamPlayback
- `void start(float from_pos)` -> `void _start(double from_pos)`
- `void mix(AudioFrame *buffer, float rate_scale, int frames)` -> `int32_t _mix(AudioFrame *buffer, double rate_scale, int32_t frames)`
I'm not going to list everything, but this should give you an idea of what has changed
I ran into this issue when following the documentation while writing C++ code that I'm compiling in a GDExtension.
I was able to rewrite the C++ example code locally to get it to compile correctly. However, I'm not entirely sure how to handle some deprecated methods.
I've included the working header and cpp files that I've written for my GDExtension. Since this is for a GDExtension and not simply engine code, I don't think it would be exactly the same for what should be in the documentation. Unless of course the documentation should be rewritten with GDExtension code in mind.
[custom_audio_stream.zip](https://github.com/godotengine/godot-docs/files/14971809/custom_audio_stream.zip)
[Custom AudioStreams](https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_audiostreams.html)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.