Skip to content
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

Exposes capture methods to AudioServer + documentation #30468

Merged
merged 2 commits into from
Aug 7, 2019

Conversation

SaracenOne
Copy link
Member

@SaracenOne SaracenOne commented Jul 9, 2019

This PR exposes the AudioDriver capture methods to the AudioServer and scripting system so they can be manually manipulated. I require this for a GDNative plugin I'm working on. It also renames some of the methods and variables for consistency, changes Vector class to a PoolVector so it can be exposed to the scripting API, and adds some missing documentation.

@StraToN
Copy link
Member

StraToN commented Jul 30, 2019

Out of curiosity (but maybe useful for documentation): is audio recording a blocking task? If so, if maybe interesting to indicate this in the docs and propose to setup a thread use in this specific case.

Also I guess a demo will be interesting to make after this PR is merged.

@SaracenOne
Copy link
Member Author

I should be able to provide a demo showing this off soon, yes (https://github.com/SaracenOne/godot_speech). I just need to provide a demo and provide a compiled version. As for blocking, everything done regarding recording is done via a thread spun up in the audio driver, and the callbacks are likewise done in this thread too.

@StraToN
Copy link
Member

StraToN commented Jul 30, 2019

@SaracenOne Alright then, thanks for the precisions. In this case, documentation part is ok for me.

@akien-mga akien-mga merged commit af935af into godotengine:master Aug 7, 2019
@akien-mga
Copy link
Member

Thanks!

@reduz
Copy link
Member

reduz commented Jan 20, 2020

This should be reverted, not only having a signal emit in the audio thread is unsafe (Connecting is not thread safe), but some of what happens in there may allocate memory, which is forbidden in the audio thread and should never be done.

akien-mga added a commit to akien-mga/godot that referenced this pull request Jan 20, 2020
…engine#30468

Reverts the following commits:

- c81ec6f:
  "Exposes capture methods to AudioServer, variable renames for
  consistency, added documentation."
- 47c558b:
  "Expose audio callbacks as signals."
- dabaa11:
  "Fix to make sure the capture buffers are deallocated at shutdown.
  Silences warnings."

Some documentation improvements were kept for pre-existing methods.

See rationale for reverting these changes in godotengine#30468.
@akien-mga
Copy link
Member

Reverted via #35359.

akien-mga added a commit that referenced this pull request Jan 20, 2020
Revert "Exposes capture methods to AudioServer + documentation" #30468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants