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:
parent
1d673ce075
commit
e12db0c182
3 changed files with 55 additions and 40 deletions
|
@ -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(); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue