1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Allow AudioStreamPlayer(2D) to provide pitch_scale on playback

This commit is contained in:
Douglas Leão
2021-10-10 13:20:56 -03:00
committed by Douglas
parent 2a28df82d4
commit 39a90751dc
5 changed files with 8 additions and 8 deletions

View File

@@ -1112,16 +1112,16 @@ float AudioServer::get_playback_speed_scale() const {
return playback_speed_scale;
}
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, StringName p_bus, Vector<AudioFrame> p_volume_db_vector, float p_start_time) {
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, StringName p_bus, Vector<AudioFrame> p_volume_db_vector, float p_start_time, float p_pitch_scale) {
ERR_FAIL_COND(p_playback.is_null());
Map<StringName, Vector<AudioFrame>> map;
map[p_bus] = p_volume_db_vector;
start_playback_stream(p_playback, map, p_start_time);
start_playback_stream(p_playback, map, p_start_time, p_pitch_scale);
}
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, Map<StringName, Vector<AudioFrame>> p_bus_volumes, float p_start_time, float p_highshelf_gain, float p_attenuation_cutoff_hz, float p_pitch_scale) {
void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, Map<StringName, Vector<AudioFrame>> p_bus_volumes, float p_start_time, float p_pitch_scale, float p_highshelf_gain, float p_attenuation_cutoff_hz) {
ERR_FAIL_COND(p_playback.is_null());
AudioStreamPlaybackListNode *playback_node = new AudioStreamPlaybackListNode();