1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-10 19:32:10 +00:00

Sounds: Queue more than two buffers if pitch is high (#14515)

Pitch changes playback speed. So always enqueuing 2 buffers did not suffice
(and it was unnecessary complicated).
This commit is contained in:
DS 2024-04-07 22:06:34 +02:00 committed by GitHub
parent 1d673ce075
commit e12db0c182
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 40 deletions

View file

@ -63,7 +63,7 @@ public:
DISABLE_CLASS_COPY(PlayingSound)
// return false means streaming finished
bool stepStream();
bool stepStream(bool playback_speed_changed = false);
// retruns true if it wasn't fading already
bool fade(f32 step, f32 target_gain) noexcept;
@ -77,7 +77,7 @@ public:
f32 getGain() noexcept;
void setPitch(f32 pitch) noexcept { alSourcef(m_source_id, AL_PITCH, pitch); }
void setPitch(f32 pitch);
bool isStreaming() const noexcept { return m_data->isStreaming(); }