1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Revert "Exposes capture methods to AudioServer + documentation" #30468

Reverts the following commits:

- c81ec6f26d:
  "Exposes capture methods to AudioServer, variable renames for
  consistency, added documentation."
- 47c558b98a:
  "Expose audio callbacks as signals."
- dabaa11b3c:
  "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 #30468.
This commit is contained in:
Rémi Verschelde
2020-01-20 13:11:47 +01:00
parent c3fd1012de
commit 837adb30fd
9 changed files with 82 additions and 157 deletions

View File

@@ -233,11 +233,11 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
if (result == noErr) {
for (unsigned int i = 0; i < inNumberFrames * ad->capture_channels; i++) {
int32_t sample = ad->input_buf[i] << 16;
ad->capture_buffer_write(sample);
ad->input_buffer_write(sample);
if (ad->capture_channels == 1) {
// In case capture device is single channel convert it to Stereo
ad->capture_buffer_write(sample);
// In case input device is single channel convert it to Stereo
ad->input_buffer_write(sample);
}
}
} else {
@@ -487,7 +487,7 @@ void AudioDriverCoreAudio::capture_finish() {
Error AudioDriverCoreAudio::capture_start() {
capture_buffer_init(buffer_frames);
input_buffer_init(buffer_frames);
OSStatus result = AudioOutputUnitStart(input_unit);
if (result != noErr) {
@@ -642,9 +642,9 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
ERR_FAIL_COND(result != noErr);
if (capture) {
// Reset audio capture to keep synchronisation.
capture_position = 0;
capture_size = 0;
// Reset audio input to keep synchronisation.
input_position = 0;
input_size = 0;
}
}
}