diff options
Diffstat (limited to 'src/3rdparty/resonance-audio/resonance_audio')
7 files changed, 35 insertions, 5 deletions
diff --git a/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h b/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h index ac60e8292..628ccaa02 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h +++ b/src/3rdparty/resonance-audio/resonance_audio/base/aligned_allocator.h @@ -72,9 +72,9 @@ void AllignedFree(PointerType mem_block_aligned) { template <typename Type, size_t Alignment> class AlignedAllocator : public std::allocator<Type> { public: - typedef typename std::allocator<Type>::pointer Pointer; - typedef typename std::allocator<Type>::const_pointer ConstPointer; - typedef typename std::allocator<Type>::size_type SizeType; + using Pointer = typename std::allocator_traits<std::allocator<Type>>::pointer; + using ConstPointer = typename std::allocator_traits<std::allocator<Type>>::const_pointer; + using SizeType = typename std::allocator_traits<std::allocator<Type>>::size_type; AlignedAllocator() { StaticAlignmentCheck<sizeof(Type), Alignment>(); } diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc index 2046699f8..cb5b85590 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.cc @@ -164,7 +164,12 @@ const AudioBuffer* GraphManager::GetAmbisonicBuffer() const { } const AudioBuffer* GraphManager::GetStereoBuffer() const { - return stereo_mixer_node_->GetOutputBuffer(); + return stereo_mixer_node_->GetOutputBuffer(); +} + +const AudioBuffer *GraphManager::GetReverbBuffer() const +{ + return reverb_node_->GetOutputBuffer(); } size_t GraphManager::GetNumMaxAmbisonicChannels() const { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h index ab797ff54..818b6fa01 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/graph_manager.h @@ -227,6 +227,15 @@ class GraphManager { // @return Output audio buffer of the stereo mix, or nullptr if no output. const AudioBuffer* GetStereoBuffer() const; + // Returns the last processed buffer containing the reverb data for the room. + // The buffer contains stereo data. + // Note that, this method will *not* trigger the processing of the audio + // graph. |GraphManager::Process| must be called prior to this method call to + // ensure that the buffer is up-to-date. + // + // @return Room reverb audio buffer, or nullptr if no output. + const AudioBuffer* GetReverbBuffer() const; + // Returns the maximum allowed number of ambisonic channels. // // @return Number of channels based on Ambisonic order in the global config. diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc index ec508144a..f8cc6731b 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.cc @@ -448,7 +448,11 @@ const AudioBuffer* ResonanceAudioApiImpl::GetAmbisonicOutputBuffer() const { } const AudioBuffer* ResonanceAudioApiImpl::GetStereoOutputBuffer() const { - return graph_manager_->GetStereoBuffer(); + return graph_manager_->GetStereoBuffer(); +} + +const AudioBuffer *ResonanceAudioApiImpl::GetReverbBuffer() const { + return graph_manager_->GetReverbBuffer(); } void ResonanceAudioApiImpl::ProcessNextBuffer() { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h index cac118387..0adbc1c67 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/resonance_audio_api_impl.h @@ -124,6 +124,11 @@ class ResonanceAudioApiImpl : public ResonanceAudioApi { // @return Pointer to stereo output buffer. const AudioBuffer* GetStereoOutputBuffer() const; + // Returns the last processed buffer containing stereo data for the room reverb + // + // @return Pointer to room reverb stereo buffer. + const AudioBuffer* GetReverbBuffer() const; + // Triggers processing of the audio graph with the updated system properties. void ProcessNextBuffer(); diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc index 36b7042bd..6a9999881 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.cc @@ -95,6 +95,11 @@ void ReverbNode::Update() { } } +const AudioBuffer* ReverbNode::GetOutputBuffer() const +{ + return &output_buffer_; +} + const AudioBuffer* ReverbNode::AudioProcess(const NodeInput& input) { if (rt60_updating_) { for (size_t i = 0; i < kNumReverbOctaveBands; ++i) { diff --git a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h index e25d0a577..f9921fa66 100644 --- a/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h +++ b/src/3rdparty/resonance-audio/resonance_audio/graph/reverb_node.h @@ -41,6 +41,8 @@ class ReverbNode : public ProcessingNode { // values depending on the system settings. void Update(); + const AudioBuffer *GetOutputBuffer() const; + protected: // Implements ProcessingNode. const AudioBuffer* AudioProcess(const NodeInput& input) override; |