1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Fix possible audio input buffer issues

This commit is contained in:
Marcelo Fernandez
2018-10-19 16:32:03 -03:00
parent cf7a66195f
commit fa26a5511d
8 changed files with 33 additions and 23 deletions

View File

@@ -80,6 +80,14 @@ double AudioDriver::get_mix_time() const {
return total;
}
void AudioDriver::input_buffer_init(int driver_buffer_frames) {
const int input_buffer_channels = 2;
input_buffer.resize(driver_buffer_frames * input_buffer_channels * 4);
input_position = 0;
input_size = 0;
}
void AudioDriver::input_buffer_write(int32_t sample) {
input_buffer.write[input_position++] = sample;