Merge pull request #52237 from ellenhp/polyphony

Add optional polyphonic playback to built-in audio player nodes
This commit is contained in:
Juan Linietsky
2021-09-07 17:38:51 -03:00
committed by GitHub
22 changed files with 428 additions and 242 deletions

View File

@@ -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);

View File

@@ -103,6 +103,8 @@ public:
virtual float get_length() const override;
virtual bool is_monophonic() const override;
AudioStreamMP3();
virtual ~AudioStreamMP3();
};

View File

@@ -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);

View File

@@ -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();
};