Omnidirectional Source Model
The Omnidirectional Source Model serves as a straightforward interface for applications to interact with the BRT Library during the rendering process. This model is characterized by its simplicity, as it primarily passes the source's position and the audio samples provided by the application to the connected modules. These modules can include listener models and environment models. Applications must supply monaural audio samples for each frame and update the source's position and orientation when necessary.
Functional Overview
To use the omnidirectional source model, it must first be instantiated and connected to the desired modules, such as listener or environment models. Once connected, the application is responsible for managing the source's position and orientation, which can be updated dynamically as needed using the method `SetSourceTransform. During each audio frame, the application must also provide the corresponding monaural audio samples, usind the SetBuffer method.
Connections
Modules to which it connects:
- Environment models
- Listener models
For C++ developer
- File: /include/SourceModels/SourceOmnidirectionalModel.hpp
- Class name: CSourceOmnidirectionalModel
- Inheritance: CSourceModelBase
- Namespace: BRTSourceModel
Class inheritance diagram
classDiagram
direction TB
class CSourceModelBase
<<interface>> CSourceModelBase
class CSourceOmnidirectionalModel
class CSourceDirectivityModel
class CVirtualSourceModel
CSourceModelBase <|-- CSourceOmnidirectionalModel
CSourceModelBase <|-- CSourceDirectivityModel
CSourceOmnidirectionalModel <|-- CVirtualSourceModel
class CBRTConnectivity
class CAdvancedEntryPointManager
class CEntryPointManager
class CExitPointManager
class CCommandEntryPointManager
CEntryPointManager <|-- CAdvancedEntryPointManager
CAdvancedEntryPointManager <|--CBRTConnectivity
CExitPointManager <|-- CBRTConnectivity
CCommandEntryPointManager <|-- CBRTConnectivity
CBRTConnectivity <|-- CSourceModelBase
How to instantiate
// Assuming that the ID of this environment model is contained in _environmentID.
brtManager.BeginSetup();
std::shared_ptr<BRTSourceModel::CSourceOmnidirectionalModel> soundSource = brtManager->CreateSoundSource<BRTSourceModel::CSourceOmnidirectionalModel>(soundSourceID);
brtManager.EndSetup();
if (soundSource == nullptr) {
// error
}
How to connect
Connect it to a listener model.// Assuming that the soundSource could be a ID(string) or a std::shared_ptr<BRTSourceModel::CSourceModelBase>;
std::shared_ptr<BRTListenerModel::CListenerModelBase> listenerModel = brtManager->GetListenerModel<BRTListenerModel::CListenerModelBase>(_listenerModelID);
if (listenerModel != nullptr) {
bool control = listenerModel->ConnectSoundSource(soundSource);
}
// Assuming that the ID of this source model is contained in _sourceID and
// that the ID of this environment is contained in _environmentModelID.
std::shared_ptr<BRTEnvironmentModel::CEnviromentModelBase> environmentModel = brtManager->GetEnvironmentModel<BRTEnvironmentModel::CEnviromentModelBase>(_environmentModelID);
if (environmentModel != nullptr) {
bool control = environmentModel->ConnectSoundSource(_sourceID);
}