summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2024-08-09 23:25:56 +0200
committerGitHub <noreply@github.com>2024-08-09 23:25:56 +0200
commit88f3b5f9d52f740b24fabfb8bc01b8b7026ba279 (patch)
treef4503e57fb6eac973afd59245b8bf033afebb2ae
parentd0fc7f73df1dd7694ef1b9284c093a3af9f26270 (diff)
parent2edf9b95b3457701439b0a7ffd2493aaf1fa7c67 (diff)
downloadredot-engine-88f3b5f9d52f740b24fabfb8bc01b8b7026ba279.tar.gz
Merge pull request #95321 from akien-mga/audio-sample-polyphonic-stop
AudioStreamPolyphonic: Implement stopping with sample playback
-rw-r--r--scene/resources/audio_stream_polyphonic.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/audio_stream_polyphonic.cpp b/scene/resources/audio_stream_polyphonic.cpp
index e617096f3b..999b0c9f0a 100644
--- a/scene/resources/audio_stream_polyphonic.cpp
+++ b/scene/resources/audio_stream_polyphonic.cpp
@@ -143,6 +143,10 @@ int AudioStreamPlaybackPolyphonic::mix(AudioFrame *p_buffer, float p_rate_scale,
}
if (s.stream_playback->get_is_sample()) {
+ if (s.finish_request.is_set()) {
+ s.active.clear();
+ AudioServer::get_singleton()->stop_sample_playback(s.stream_playback->get_sample_playback());
+ }
continue;
}