-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Expose some AudioStreamPlayback methods (namely mix_audio()
).
#86539
Expose some AudioStreamPlayback methods (namely mix_audio()
).
#86539
Conversation
455463d
to
18ce8c7
Compare
6d233fe
to
d9d1cc4
Compare
We really should have a story here because a lot of users want to get raw pcm data from a stream and it is currently impossible without a gdextension. |
Just a note, correct me if I'm wrong: unless you're referring to something other than the |
bb04772
to
cd288b5
Compare
I remember pushback on the lines of "GDScript is too slow for that", but we should be able to use GDScript to connect this to a mixing solution in GPU, for example with compute shaders. In fact, I was able to use the fragment shader in Godot 3.x to generate audio. I shared a proof of concept in discussions: godotengine/godot-proposals#6476 (comment) Futhermore, Godot have integration with other lnaguages that are considered faster such as C# and rust. I have a post by Juan Linietsky agreeing on exposing more audio internals: https://x.com/reduzio/status/1683126371013349378 Thus, I hope this does not get the "It won't work on GDScript" treatment. |
I dislike the fact that I'm exposing this to GDScript at all but "should some things only be exposed on GDExt and not C#/GDS" is a much larger and possibly controversial discussion. This PR is not the ideal solution (I've learned this with time, see stechyo/godot-steam-audio#39), but I'm not aware of any efforts to do something similar but in a cleaner way (again, "knowing what is being worked on" is sometimes an issue in Godot, but again, that's another discussion). |
Looks good to me other than what I mentioned. |
cd288b5
to
5f70fe0
Compare
82eaf7f
to
0c1c485
Compare
Since much of the code and especially the documentation is the same as my original PR I have to ask if you salvaged that one? |
Yeah, as I said in the description it's pretty much the same as two other PRs. Is there some "salvaging etiquette" I'm not aware of? |
I'd say that explicitly stating it would be good in the future as it's not clear from "essentially the same", copying code is something you need to be explicit about (doing so without being clear would usually be called plagiarism) I'd ask that you add me as a co-author in that case, by adding:
To your commit (the empty line is important) Thank you! |
0c1c485
to
5170a6c
Compare
The XML description was certainly salvaged, so it's more than reasonable to add you as a co-author. Sorry for not having done so previously! |
5170a6c
to
683127d
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
Any chances to see this PR merged into 4.3? |
4.3 is in final release phase so this will be not be merged before 4.4 |
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
683127d
to
e479c23
Compare
Now that 4.3 has released, when could we merge this so that it's ready for 4.4? It seems there's no issues remaining with the code. |
It needs an approval by the audio team |
Just wondering, before approving the PR.
|
|
To add a bit to this. It was specifically static ( so audio visualizers that show the whole songs graph ( think audacity ) as opposed to the ones you'd see on a music player) that were a major pain to do beforehand. So yeah this is very much appreciated for that sort of thing. |
@adamscott do these answers block your approval? Just wondering |
@stechyo I'm investigating. I'm gonna give you an answer shortly. |
It seems that surround is only done at the server level when adjusting volume, so no need for a special case for surround systems. Sorry, I mixed up stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes IMO, but your PR is close to be merged!
mix_audio()
).
I think all changes should be addressed :) could someone approve the workflow? |
@adamscott is anything missing to merge? Just checking, idk what the etiquette is on this repo (if the commenter needs to resolve conversations, or if it's the PR author who does so). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me!
Awesome! @reduz I think your requested change should be addressed as well, can we merge this? |
@reduz @AThousandShips my apologies for double-pinging here, but this PR has been approved by one engine maintainer and the comment of another maintainer has been addressed for a while now. Is there anything I can do to help merge this? I would love to get this in before the 4.4 freeze begins, and it seems to be ready to merge. |
I set the PR in the merge queue, so it should be merged as soon as possible. Thanks again for the PR! |
Thanks, and congratulations on your first contribution! 🎉 |
Pretty much the same as:
AudioStreamPlayback
methods #75065The former is archived, and the latter seems to go against the maintainers' wishes that
start
,stop
, andmix
should not be exposed outward. I added some shim functions to get around this, not sure if that's fine. There are several proposals with different use cases for this:My usecase is embedding steam-audio as a GDExtension, which requires me to have these functions available as bound methods.