summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2021-09-07 17:38:51 -0300
committerGitHub <noreply@github.com>2021-09-07 17:38:51 -0300
commitca11f8ad3045c280b559adea4e2263c38c2c6df4 (patch)
treea8387f731c0a35abe224bccf8cb82e672193b645 /modules
parent43c896ac6a309bca229619a6d295918a3b656d6a (diff)
parent0e3cab41ebac855fbf13b4c409e42d2661c5842b (diff)
Merge pull request #52237 from ellenhp/polyphony
Add optional polyphonic playback to built-in audio player nodes
Diffstat (limited to 'modules')
-rw-r--r--modules/minimp3/audio_stream_mp3.cpp4
-rw-r--r--modules/minimp3/audio_stream_mp3.h2
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.cpp4
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.h2
4 files changed, 12 insertions, 0 deletions
diff --git a/modules/minimp3/audio_stream_mp3.cpp b/modules/minimp3/audio_stream_mp3.cpp
index fb741f6266..7b52ef178a 100644
--- a/modules/minimp3/audio_stream_mp3.cpp
+++ b/modules/minimp3/audio_stream_mp3.cpp
@@ -214,6 +214,10 @@ float AudioStreamMP3::get_length() const {
return length;
}
+bool AudioStreamMP3::is_monophonic() const {
+ return false;
+}
+
void AudioStreamMP3::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_data", "data"), &AudioStreamMP3::set_data);
ClassDB::bind_method(D_METHOD("get_data"), &AudioStreamMP3::get_data);
diff --git a/modules/minimp3/audio_stream_mp3.h b/modules/minimp3/audio_stream_mp3.h
index 5dd88779f8..3c8bdd8c53 100644
--- a/modules/minimp3/audio_stream_mp3.h
+++ b/modules/minimp3/audio_stream_mp3.h
@@ -103,6 +103,8 @@ public:
virtual float get_length() const override;
+ virtual bool is_monophonic() const override;
+
AudioStreamMP3();
virtual ~AudioStreamMP3();
};
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
index 3a938200e9..6554c6e274 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
@@ -252,6 +252,10 @@ float AudioStreamOGGVorbis::get_length() const {
return length;
}
+bool AudioStreamOGGVorbis::is_monophonic() const {
+ return false;
+}
+
void AudioStreamOGGVorbis::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_data", "data"), &AudioStreamOGGVorbis::set_data);
ClassDB::bind_method(D_METHOD("get_data"), &AudioStreamOGGVorbis::get_data);
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
index 756c241d1f..1311c4ce7a 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
@@ -105,6 +105,8 @@ public:
virtual float get_length() const override; //if supported, otherwise return 0
+ virtual bool is_monophonic() const override;
+
AudioStreamOGGVorbis();
virtual ~AudioStreamOGGVorbis();
};