### Begin Setup Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-hrtf/ Prepares the HRTF object for initialization and starts the configuration process. ```APIDOC ## Begin Setup ### Description Prepares the HRTF object for initialization and starts the configuration process. ### Method Begin Setup ### Parameters None ### Response None ``` -------------------------------- ### Begin Setup Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-ambisonic-bir/ Initializes the setup process with the specified ambisonic order and normalization scheme. ```APIDOC ## Begin Setup ### Description Initializes the setup process with the specified ambisonic order and normalization scheme. ### Method Begin Setup ### Parameters - **ambisonicOrder** (type not specified) - Required - The ambisonic order. - **normalizationScheme** (type not specified) - Required - The normalization scheme. ### Response No response details provided. ``` -------------------------------- ### End Setup Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-ambisonic-bir/ Completes the setup process and confirms the system is ready. ```APIDOC ## End Setup ### Description Completes the setup process and confirms the system is ready. ### Method End Setup ### Parameters None specified. ### Response No response details provided. ``` -------------------------------- ### End Setup Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-hrtf/ Finalizes the setup process and stores the configured HRTF data. ```APIDOC ## End Setup ### Description Finalizes the setup process and stores the configured HRTF data. ### Method End Setup ### Parameters None ### Response None ``` -------------------------------- ### Instantiation and Connection Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example code showing how to instantiate the CSOSBilateralFilterModel and connect it to a listener and a listener model. ```APIDOC ## Instantiation and Connection Example ### Description This example demonstrates how to create a `CSOSBilateralFilterModel` using the BRT manager and connect it to a listener and a listener model. ### Code Example ```cpp brtManager.BeginSetup(); std::shared_ptr binauralFilter = brtManager.CreateBinauralFilter(_binauralFilterID); brtManager.EndSetup(); if (binauralFilter == nullptr) { // ERROR } std::shared_ptr listener = brtManager.GetListener(_listenerID); if (listener != nullptr) { brtManager.BeginSetup(); bool control = listener->ConnectBinauralFilter(_binauralFilterID); brtManager.EndSetup(); } std::shared_ptr binauralFilter = brtManager.GetBinauralFilter(_binauralFilterID); if (binauralFilter != nullptr) { brtManager.BeginSetup(); bool control = binauralFilter->ConnectListenerModel(_listenerModelID); brtManager.EndSetup(); } ``` ``` -------------------------------- ### soundLevelAlert Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /control/soundLevelAlert command sent by BeRTA. ```plaintext /control/soundLevelAlert 60 62 ``` -------------------------------- ### /listener/orientation example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/orientation command. BeRTA receives and echoes back to all subscribers except the sender. ```plaintext /listener/orientation defaultListener 0.1 0 0 ``` -------------------------------- ### /recordIR Example Command Source: https://grupodiana.github.io/BRT-Documentation/osc/overall/ Example of the /recordIR command as received and echoed by BeRTA, with a wav file, 2-second duration, and directivity enabled. ```text /recordIR "record/sytem_conf_IR.wav" "wav" 2 0 0 1 0 0 Directivity1 true ``` -------------------------------- ### /playAndRecord example command and results Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of /playAndRecord with a 10-second recording, showing the echo and both success and failure result messages. ```plaintext /playAndRecord c:/tmp/file.mat mat 10 ``` ```plaintext /control/actionResult /playAndRecord c:/tmp/file.mat true Recording completed. File saved : c:/tmp/file.mat ``` ```plaintext /control/actionResult /playAndRecord c:/tmp/file.mat false ERROR:Recording failed. File could not be created. ``` -------------------------------- ### /record example command and results Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of /record with a 10-second processing time, showing the echo and both success and failure result messages. ```plaintext /record c:/tmp/file.mat mat 10 ``` ```plaintext /control/actionResult /record c:/tmp/file.mat true Recording completed. File saved : c:/tmp/file.mat ``` ```plaintext /control/actionResult /record c:/tmp/file.mat false ERROR:Recording failed. File could not be created. ``` -------------------------------- ### OSC command: /environment/setReflectionOrder example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving and echoing the command, and sending back the action result. ```plaintext /environment/setReflectionOrder ISM 3 ``` ```plaintext /control/actionResult /environment/setReflectionOrder ISM true "Reflection Order updated in the model (ISM) to 3. ``` -------------------------------- ### Instantiation and Connection Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example code showing how to instantiate an omnidirectional source model and connect it to listener and environment models using the BRT manager. ```APIDOC ## Instantiation and Connection Example ### Description Example code showing how to instantiate an omnidirectional source model and connect it to listener and environment models using the BRT manager. ### Code Example ```cpp // Assuming that the ID of this environment model is contained in _environmentID. brtManager.BeginSetup(); std::shared_ptr soundSource = brtManager->CreateSoundSource(soundSourceID); brtManager.EndSetup(); if (soundSource == nullptr) { // error } // Assuming that the soundSource could be a ID(string) or a std::shared_ptr; std::shared_ptr listenerModel = brtManager->GetListenerModel(_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 environmentModel = brtManager->GetEnvironmentModel(_environmentModelID); if (environmentModel != nullptr) { bool control = environmentModel->ConnectSoundSource(_sourceID); } ``` ``` -------------------------------- ### OSC command: /environment/setRoom example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving and echoing the command, and sending back the action result. Shows an error when room is not found. ```plaintext /environment/setRoom SDN room1 ``` ```plaintext /control/actionResult /environment/setRoom SDN false "ERROR setting Room to the environment room1 not found in the Room list']. ``` -------------------------------- ### Get filter info example - request and response Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of /resources/getFilterInfo: BeRTA receives a request and sends back the SOFA file name. ```plaintext /resources/getFilterInfo NFCF1 ``` ```plaintext /resources/getFilterInfo NFCF1 NFCFilters.sofa ``` -------------------------------- ### OSC command: /environment/setMaxDistanceSourcesToListener example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving and echoing the command, and sending back the action result. ```plaintext /environment/setMaxDistanceSourcesToListener ISM 10.5 ``` ```plaintext /control/actionResult /environment/setMaxDistanceSourcesToListener ISM true "Max Distance Sources to Listener updated in the model (ISM) to 10.5m. ``` -------------------------------- ### /resources/loadHRTF example and echo Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving and echoing back the /resources/loadHRTF command, and the return message sent to the sender. ```plaintext /resources/loadHRTF HRTF1 c:/tmp/hrtf.sofa 5 ``` ```plaintext /control/actionResult /resources/loadHRTF HRTF1 true HRTF HRTF1 loaded successfully, with a spatial resolution of 5, from the file: c:/tmp/hrtf.sofa ``` ```plaintext /control/actionResult /resources/loadHRTF HRTF1 false HRTF sofa file couldn't be loaded from HRTF1 . ``` -------------------------------- ### /listener/location example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/location command. BeRTA receives and echoes back to all subscribers except the sender. ```plaintext /listener/location defaultListener 0 0 0 ``` -------------------------------- ### getListenerSoundLeveldBFS Unknown Listener Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /control/getListenerSoundLeveldBFS command when the requested listener does not exist, returning valid=false and an error description. ```plaintext /control/getListenerSoundLeveldBFS Unknown ``` ```plaintext /control/getListenerSoundLeveldBFS Unknown false -inf -inf "Listener Unknown does not exist." ``` -------------------------------- ### BeRTA /source/orientation example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example command that BeRTA receives and echoes back to all subscribers except the sender. ```plaintext /source/orientation source1 0 0 0 ``` -------------------------------- ### /source/play command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/play command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends a /control/actionResult confirmation to the sender. ```plaintext /source/play source1 ``` ```plaintext /control/actionResult /source/play source1 true Audio source source1 played back ``` -------------------------------- ### BeginSetup Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Initializes the FIR table setup with the given HRIR length and extrapolation method. ```APIDOC ## BeginSetup ### Description Initializes the FIR table setup with the given HRIR length and extrapolation method. ### Method bool BeginSetup(const int32_t & _HRIRLength, const BRTServices::TEXTRAPOLATION_METHOD & _extrapolationMethod) override ### Parameters - `_HRIRLength` (int32_t) - Length of the HRIR. - `_extrapolationMethod` (BRTServices::TEXTRAPOLATION_METHOD) - Extrapolation method. ### Returns bool - True if setup began successfully. ``` -------------------------------- ### Enable Reverb Path Command Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /environment/enableReverbPath command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext /environment/enableReverbPath SDN false ``` ```plaintext /control/actionResult /environment/enableReverbPath SDN true "Environment model SDN Reverb path enabled" ``` -------------------------------- ### Resources JSON configuration example Source: https://grupodiana.github.io/BRT-Documentation/applications/settingsFile/ Example JSON for the 'Resources' section. Lists HRTFs, BRIRs, filters, directivities, and rooms to load at startup. Each entry includes an ID and a fileName, with optional parameters like spatialResolution and fadeInWindowThreshold. Rooms can be defined by dimensions or by loading an OBJ file. ```json "Resources" : { "HRTFs": [{"ID": "HRTF1", "fileName": "resources//HRTF//3DTI_HRTF_SADIE_II_D2_256s_48000Hz_resampled5.sofa", "spatialResolution": 5}], "BRIRs": [{"ID": "BRIR1", "fileName": "resources//BRIR//3DTI_BRIR_Trapezoid_48000Hz_3D.sofa", "spatialResolution": 15, "fadeInWindowThreshold" : 0, "fadeInWindowRiseTime": 0, "fadeOutWindowThreshold" : 0, "fadeOutWindowRiseTime": 0}], "Filters": [ {"ID": "DefaultNFFilters", "fileName": "resources//SOSFilters//NearFieldCompensation_ILD_1.2m_48Khz.sofa"}, {"ID": "JBLCompensation", "fileName": "resources//Filters//Phone_Compensation_JBLQuantum100_48000.sofa"} ], "Directivities": [ {"ID": "Directivity1", "fileName": "resources//Directivity//Cardioid_LP_30dB_512s_resampled10_normalized_fir_512.sofa"} ], Rooms":[ {"ID": "Room1", "length": 3, "width":5.5, "height": 3}, {"ID": "Room2", "fileName": "resources//OBJ//A108_room.obj"} ] }, ``` -------------------------------- ### Enable Direct Path Command Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /environment/enableDirectPath command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext /environment/enableDirectPath SDN false ``` ```plaintext /control/actionResult /environment/enableDirectPath SDN true "Environment model SDN Direct path enabled" ``` -------------------------------- ### Enable Propagation Delay Command Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /environment/enablePropagationDelay command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext /environment/enablePropagationDelay FreeFieldEnvironmentModel true ``` ```plaintext /control/actionResult /environment/enablePropagationDelay FreeFieldEnvironmentModel true "Propagation delay in the FreeFieldEnvironmentModel model enabled." ``` -------------------------------- ### Load SOS filters example - echo and response Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of /resources/loadSOSFilters: BeRTA echoes to subscribers and sends an actionResult to the sender. ```plaintext /resources/loadSOSFilters SOSF1 c:/tmp/SOSilters.sofa ``` ```plaintext /control/actionResult /resources/loadSOSFilters NFCF1 true SOS filter SOSF1 loaded successfully, from the file: c:/tmp/SOSilters.sofa ``` ```plaintext /resources/loadSOSFilters SOSF1 false ERROR deleting SOS filter. SOSF1 not found in the list. ``` -------------------------------- ### /source/record command example Source: https://grupodiana.github.io/BRT-Documentation/osc/source/ Example command sent to BeRTA to record a source. The command includes source_id 'SoundSource1', filename 'C:/tmp/testingRecord', type 'mat', and duration 3 seconds. ```plaintext /source/record SoundSource1 C:/tmp/testingRecord mat 3 ``` -------------------------------- ### BeRTA /listener/enableSpatialization example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/enableSpatialization command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext BeRTA receives and echoes back to all subscribiers but the sender: /listener/enableSpatialization DefaultListener true BeRTA sends back to the sender: /control/actionResult /listener/enableSpatialization defaultListener true "Spatialization enabled" ``` -------------------------------- ### recordIR example and return messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving and echoing back the recordIR command, followed by possible return messages indicating success or failure. ```plaintext /recordIR "record/sytem_conf_IR.wav" "wav" 2 0 0 1 0 0 Directivity1 true ``` ```plaintext /control/actionResult /recordIR record/system_conf_IR.wav true Recording completed. File saved: record/sytem_conf_IR.wav ``` ```plaintext /control/actionResult /recordIR record/sytem_conf_IR.wav false ERROR:Recording failed. File could not be created. ``` ```plaintext /control/actionResult /recordIR Directivity1 false ERROR:setting Directivity to the source. Directivity not found into the directivity list. ``` -------------------------------- ### playCalibration command example Source: https://grupodiana.github.io/BRT-Documentation/osc/control/ Example of the /control/playCalibration command sent to BeRTA and the corresponding actionResult response. The command requires a dBFS level and an even channel number. ```text /control/playCalibration -40 0 ``` ```text /control/actionResult /control/playCalibration calibration true "Calibration sound played" ``` -------------------------------- ### getListenerSoundLeveldBSPL example with no calibration reference Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example response when listener B has no calibration reference, returning valid=false and -inf levels with an error message. ```plaintext /control/getListenerSoundLeveldBSPL B false -inf -inf "Listener B has no direct output or valid calibration reference." ``` -------------------------------- ### play Syntax Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Syntax for the /play command. Starts playing back all sources from audio files and starts streaming all sources from input channels. ```plaintext /play ``` -------------------------------- ### /listener/setHRTF example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/setHRTF command. BeRTA receives and echoes back to all subscribers except the sender, and sends a confirmation to the sender. ```plaintext /listener/setHRTF defaultListener HRTF1 ``` ```plaintext /control/actionResult /listener/setHRTF defaultListener true "HRTF HRTF1 has been set to listener defaultListener" ``` -------------------------------- ### GeneralSettings JSON configuration example Source: https://grupodiana.github.io/BRT-Documentation/applications/settingsFile/ Example of the GeneralSettings section in the JSON configuration file. It sets sample rate, buffer size, buffer frames, OSC listen port, extrapolation method, default audio interfaces, and log file options. The DefaultInputAudioInterface and DefaultOutputAudioInterface are set to -1 to use the operating system defaults if not found. ```json "GeneralSettings": { "SampleRate": 48000, "BufferSize": 512, "BufferFrames": 4, "OSCListenPort": 10017, "ExtrapolationMethod": "NearestPoint", "DefaultInputAudioInterface": -1, "DefaultOutputAudioInterface": -1, "LogFile": true, "LogFilePath" : "", } ``` -------------------------------- ### /source/pause command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/pause command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends a /control/actionResult confirmation to the sender. ```plaintext /source/pause source1 ``` ```plaintext /control/actionResult /source/pause source1 true Audio source source1 paused. ``` -------------------------------- ### /source/playAndRecord - Example Messages Source: https://grupodiana.github.io/BRT-Documentation/osc/source/ Example OSC messages for /source/playAndRecord. The first is echoed to all subscribers except the sender; the second is the action result sent back to the sender. ```plaintext /source/playAndRecord SoundSource1 C:/tmp/testingRecord mat 3 ``` ```plaintext /control/actionResult /source/playAndRecord source1 true "Recording completed. File saved: C:/tmp/testingRecord ``` -------------------------------- ### setCalibration command example Source: https://grupodiana.github.io/BRT-Documentation/osc/control/ Example of the /control/setCalibration command sent to BeRTA and the corresponding actionResult response. The command requires dBFS and dBSPL levels and an even channel number. ```text /control/setCalibration -40 60 0 ``` ```text /control/actionResult /control/setCalibration calibrationDone true "Calibration done with -40 dB FS and 60 dB SPL." ``` -------------------------------- ### SceneConfiguration OSC commands JSON example Source: https://grupodiana.github.io/BRT-Documentation/applications/settingsFile/ Defines scene configuration using OSC commands. Each entry has a command and parameters array. Examples include looping a sound source, setting HRTF, SOS filters, and BRIR for a listener. ```json "SceneConfiguration": [ {"command": "/source/loop", "parameters": ["SoundSource1", "true"]}, {"command": "/listener/setHRTF", "parameters": ["DefaultListener", "HRTF1"]}, {"command": "/listener/setSOSFilters", "parameters": ["DefaultListener", "DefaultNFFilters"]}, {"command": "/listener/setBRIR", "parameters": ["DefaultListener", "BRIR1"]} ], ``` -------------------------------- ### BeRTA /resources/getHRTFInfo example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of requesting HRTF information. BeRTA sends back the SOFA filename and spatial resolution used for resampling. ```plaintext /resources/getHRTFInfo HRTF1 ``` ```plaintext /resources/getHRTFInfo HRTF1 hrtf.sofa 5 ``` -------------------------------- ### /source/playAndRecord command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/playAndRecord OSC command. BeRTA receives the command and echoes it back to all subscribers except the sender. The sender receives an actionResult with recorded=true on success. ```plaintext /source/playAndRecord SoundSource1 C:/tmp/testingRecord mat 3 ``` -------------------------------- ### EndSetup Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Finalizes the FIR table setup after all impulse responses have been added. ```APIDOC ## EndSetup ### Description Finalizes the FIR table setup after all impulse responses have been added. ### Method bool EndSetup() override ### Parameters None. ### Returns bool - True if setup ended successfully. ``` -------------------------------- ### BeRTA getDirectivityTFInfo example messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving a getDirectivityTFInfo command and sending back the SOFA file name and spatial resolution. ```plaintext /resources/getDirectivityTFInfo directivityTF1 ``` ```plaintext /resources/getDirectivityTFInfo directivityTF1 directivityTF.sofa 15 ``` -------------------------------- ### /source/mute command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/mute command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends a /control/actionResult confirmation to the sender. ```plaintext /source/mute source1 ``` ```plaintext /control/actionResult /source/mute source1 true Audio source source1 muted. ``` -------------------------------- ### /source/stop command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/stop command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends a /control/actionResult confirmation to the sender. ```plaintext /source/stop source1 ``` ```plaintext /control/actionResult /source/stop source1 true Audio source source1 removed. ``` -------------------------------- ### BeRTA /listener/setSOSFilters example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/setSOSFilters command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext BeRTA receives and echoes back to all subscribiers but the sender: /listener/setSOSFilters DefaultListener NFCFilters1 BeRTA sends back to the sender: /control/actionResult /listener/setSOSFilters defaultListener true "SOSFilters NFCFilters1 has been set to listener defaultListener" ``` -------------------------------- ### BeRTA /source/gain example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example command and return message for setting source gain. BeRTA echoes the command to all subscribers except the sender, and sends the action result to the sender. ```plaintext /source/gain source1 -3 ``` ```plaintext /control/actionResult /source/gain source1 true Audio source source1 gain updated to -3 dB ``` -------------------------------- ### /source/unmute command example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /source/unmute command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends a /control/actionResult confirmation to the sender. ```plaintext /source/unmute source1 ``` ```plaintext /control/actionResult /source/unmute source1 true Audio source source1 unmuted. ``` -------------------------------- ### BeRTA /listener/enableInterpolation example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/enableInterpolation command. BeRTA receives the command and echoes it back to all subscribers except the sender, then sends an action result to the sender. ```plaintext BeRTA receives and echoes back to all subscribiers but the sender: /listener/enableInterpolation DefaultListener true BeRTA sends back to the sender: /control/actionResult /listener/enableInterpolation defaultListener true "Interpolation enabled to defaultListener" ``` -------------------------------- ### getListenerSoundLeveldBSPL example with standby listener and virtual reference Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example response for virtual listener B referencing listener A in standby, with calibration offset 100 dB and digital levels -30/-28 dBFS. ```plaintext /control/getListenerSoundLeveldBSPL B true 70 72 "" ``` -------------------------------- ### BeRTA /resources/loadHRTF example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of loading an HRTF from a SOFA file. BeRTA echoes the command to all subscribers except the sender, and sends an action result back to the sender indicating success or failure. ```plaintext /resources/loadHRTF HRTF1 c:/tmp/hrtf.sofa ``` ```plaintext /control/actionResult /resources/loadHRTF HRTF1 true HRTF HRTF1 loaded successfully from the file: c:/tmp/hrtf.sofa ``` ```plaintext /control/actionResult /resources/loadHRTF HRTF1 false HRTF sofa file couldn't be loaded from HRTF1 . ``` -------------------------------- ### /control/playCalibration Source: https://grupodiana.github.io/BRT-Documentation/osc/ Start the calibration process. ```APIDOC ## /control/playCalibration ### Description Start the calibration process. ### Method OSC ### Endpoint /control/playCalibration ``` -------------------------------- ### Connect SphericalSOSTable to a listener model Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-spherical-sos-table/ C++ example showing how to get a listener by ID and set near-field compensation filters. Assumes the listener ID is in _listenerID and the HRTF is already successfully loaded into hrtf. ```cpp // Assuming that the ID of this listener is contained in _listenerID and // that the HRTF is already lsuccessfuly loaded into hrtf. std::shared_ptr listener = brtManager->GetListener(listenerID); listener->SetNearFieldCompensationFilters(hrtf); ``` -------------------------------- ### Play reference signal with /control/playCalibration Source: https://grupodiana.github.io/BRT-Documentation/applications/calibration/ Starts the reference signal at the specified digital RMS level on the given output pair. The example plays at -40 dBFS on channels 0-1. BeRTA plays the file resources/Calibration/CalibrationPinkNoise.wav in a loop, sending identical samples to both channels. The request is rejected if sample rate mismatch, gain calculation fails, or clipping would occur. ```OSC /control/playCalibration -40 0 ``` -------------------------------- ### getListenerSoundLeveldBSPL example with active listener Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example response for listener B with active listener A assigned to channels 0-1, calibration offset 100 dB, and digital levels -29/-27 dBFS. ```plaintext /control/getListenerSoundLeveldBSPL B true 71 73 "" ``` -------------------------------- ### /source/addLineIn example messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example OSC messages for /source/addLineIn: BeRTA echoes the command to all subscribers except the sender, then sends a result to the sender with success or error description. ```plaintext /source/addLineIn source1 1 DirectivityModel ``` ```plaintext /control/actionResult /source/addLineIn source1 true AUDIO LINE-IN source1 configured succesfully ``` ```plaintext /source/addLineIn source1 false error: not a valid channel ``` -------------------------------- ### /play Source: https://grupodiana.github.io/BRT-Documentation/osc/ Starts playback of file sources and streaming from input channels. ```APIDOC ## /play ### Description Starts playback of file sources and streaming from input channels. ### Method OSC ### Endpoint /play ``` -------------------------------- ### BeginSetup(...) Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-spherical-fir-table/ Initializes the table configuration before inserting impulse responses. ```APIDOC ## BeginSetup(...) ### Description Initializes the table configuration before inserting impulse responses. ### Method BeginSetup ### Parameters - **...** (unspecified) - Required - Configuration parameters for the setup. ### Returns Void. ``` -------------------------------- ### BeRTA receives /control/bufferFrames and sends back /control/bufferFrames 2 Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /control/bufferFrames command exchange. BeRTA receives the command and responds with an echo including the number of buffered frames (2 in this example). ```OSC /control/bufferFrames ``` ```OSC /control/bufferFrames 2 ``` -------------------------------- ### Models Architecture JSON configuration example Source: https://grupodiana.github.io/BRT-Documentation/applications/settingsFile/ Example JSON for the 'ModelsArchitecture' section. Defines listeners, listener models (e.g., ListenerDirectHRTFConvolution), environment models (e.g., FreeFieldEnvironmentModel), bilateral filters (e.g., SOSBilateralFilter), default source connections, model-to-model connections, and listener connections. Note the typo 'SOSBilateralFilter' in the source. ```json "ModelsArchitecture": { "Listeners": ["DefaultListener"], "ListenerModels": [ {"ID": "DirectPath", "Model": "ListenerDirectHRTFConvolution"}, {"ID": "ReverbPath", "Model": "ListenerAmbisonicReverberantVirtualLoudspeakersModel"} ], "EnvironmentModels": [{"ID": "FreeField", "Model": "FreeFieldEnvironmentModel"}], "BilateralFilters":[{"ID": "Bilateral1", "Model": "SOSBilateralFilter"}], "ConnectSourcesTo":["FreeField", "ReverbPath"], "Model2ModelConnections": [{"OriginID":"FreeField", "DestinationID":"DirectPath"}], "ConnectToListener":[ {"ModelID":"DirectPath", "ListenerID":"DefaultListener"}, {"ModelID":"ReverbPath", "ListenerID":"DefaultListener"} ], }, ``` -------------------------------- ### Instantiate CListenerAmbisonicReverberantVirtualLoudspeakersModel Source: https://grupodiana.github.io/BRT-Documentation/library/listener-models/rir-models/listener-acoustic-environment-model-ambisonic-brir/ Shows how to create the listener model using brtManager.BeginSetup(), CreateListenerModel, and EndSetup(). Checks for nullptr to handle errors. ```cpp // Assuming that the ID of this listener model is contained in _listenerModelID. brtManager.BeginSetup(); std::shared_ptrlistenerModel = brtManager.CreateListenerModel(_listenerModelID); brtManager.EndSetup(); if (listenerModel == nullptr) { // ERROR } ``` -------------------------------- ### Remove filter example - echo and response Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of /resources/removeFilter: BeRTA echoes to subscribers and sends an actionResult to the sender. ```plaintext /resources/removeFilter EarMuffFilter ``` ```plaintext /control/actionResult /resources/removeFilter EarMuffFilter true Filter coefs. (EarMuffFilter) removed from the resource list. ``` ```plaintext /control/actionResult /resources/removeFilter EarMuffFilter false ERROR deleting coefs. (EarMuffFilter) not found in the list. ``` -------------------------------- ### SetupShoeBox() Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-room/ Creates a rectangular (shoebox) room defined by length (X), width (Y), and height (Z). Generates six walls with proper geometry, inward-facing normals, editable absorption coefficients, and optional activation/deactivation. Walls cannot be reshaped but absorption and active status can be modified. ```APIDOC ## SetupShoeBox() ### Description Creates a rectangular (shoebox) room defined by length (X), width (Y), and height (Z). Generates six walls with proper geometry, inward-facing normals, editable absorption coefficients, and optional activation/deactivation. Walls cannot be reshaped but absorption and active status can be modified. ### Method SetupShoeBox ### Parameters - **length** (float) - Required - Length along X axis - **width** (float) - Required - Width along Y axis - **height** (float) - Required - Height along Z axis ### Response Returns a room object with six walls, each having editable absorption coefficients and active status. ``` -------------------------------- ### getListenerSoundLeveldBFS Silent Listener Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /control/getListenerSoundLeveldBFS command for a valid silent listener, returning -inf for both channels. ```plaintext /control/getListenerSoundLeveldBFS B true -inf -inf "" ``` -------------------------------- ### Example exchange for stopCalibrationTest Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving a stopCalibrationTest command and sending back an actionResult with success=true and a description. ```plaintext /control/stopCalibrationTest 0 ``` ```plaintext /control/actionResult /control/stopCalibrationTest calibrationTest true "Calibration test stopped." ``` -------------------------------- ### bool BeginSetup(const int32_t & _HRIRLength, const BRTServices::TEXTRAPOLATION_METHOD & _extrapolationMethod) override Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-spherical-interpolated-fir-table/ Initializes the table configuration before inserting impulse responses. ```APIDOC ## bool BeginSetup(const int32_t & _HRIRLength, const BRTServices::TEXTRAPOLATION_METHOD & _extrapolationMethod) override ### Description Initializes the table configuration before inserting impulse responses. ### Method Override ### Signature `bool BeginSetup(const int32_t & _HRIRLength, const BRTServices::TEXTRAPOLATION_METHOD & _extrapolationMethod) override` ### Parameters - **_HRIRLength** (const int32_t &) - Required - The length of the HRIRs. - **_extrapolationMethod** (const BRTServices::TEXTRAPOLATION_METHOD &) - Required - The extrapolation method to use. ### Returns - **bool** - True if setup was successful, false otherwise. ``` -------------------------------- ### BeRTA /resources/getHRTFHeadRadius example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of requesting the head radius of an HRTF. BeRTA sends back the head radius value. ```plaintext /resources/getHRTFHeadRadius HRTF1 ``` ```plaintext /resources/getHRTFHeadRadius HRTF1 0.09 ``` -------------------------------- ### Example exchange for playCalibrationTest Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving a playCalibrationTest command and sending back an actionResult with success=false and an error description. ```plaintext /control/playCalibrationTest 80 2 ``` ```plaintext /control/actionResult /control/playCalibrationTest calibrationTest false "ERROR BeRTA has not been calibrated yet" ``` -------------------------------- ### /listener/setBRIR example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /listener/setBRIR command. BeRTA receives and echoes back to all subscribers except the sender, and sends a confirmation to the sender. ```plaintext /listener/setBRIR defaultListener BRIR1 ``` ```plaintext /control/actionResult /listener/BRIR1 defaultListener true "BRIR BRIR1 has been set to listener defaultListener" ``` -------------------------------- ### CSDNEnvironmentModel - Instantiate Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Shows how to create an SDN environment model using the BRT manager's CreateEnvironment method. ```APIDOC ## CSDNEnvironmentModel - Instantiate ### Description Creates an SDN environment model instance via the BRT manager. ### Method CreateEnvironment (C++ template method) ### Endpoint brtManager.CreateEnvironment(_environmentID) ### Parameters - **environmentID** (string) - Required - The ID of the environment model to create. ### Request Example ```cpp // Assuming that the ID of this environment model is contained in _environmentID. brtManager.BeginSetup(); std::shared_ptr environmentModel = brtManager.CreateEnvironment(_environmentID); brtManager.EndSetup(); if (environmentModel == nullptr) { // error } ``` ### Response Returns a shared_ptr to the created environment model, or nullptr on error. ``` -------------------------------- ### Is Ready Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-ambisonic-bir/ Checks if the system is ready and the BRIR is loaded. ```APIDOC ## Is Ready ### Description Checks if the system is ready and the BRIR is loaded. ### Method Is Ready ### Parameters None specified. ### Response Returns a boolean indicating readiness. ``` -------------------------------- ### setSoundLevelLimit Example Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of the /control/setSoundLevelLimit command and its response. The return confirmation refers to the action calibrationTest, with success=false and an error description when not calibrated. ```plaintext /control/setSoundLevelLimit 100 0 ``` ```plaintext /control/actionResult /control/setSoundLevelLimit calibrationTest false "ERROR Sound level limit has not been set becasuse BeRTA has not been calibrated." ``` -------------------------------- ### SetupRoomGeometry() Source: https://grupodiana.github.io/BRT-Documentation/library/service-modules/service-room/ Accepts a TRoomGeometry structure containing a list of corner vertices and a list of walls (each defined by a list of vertex indices). This is the natural endpoint of the OBJ loader and allows custom convex room construction programmatically. ```APIDOC ## SetupRoomGeometry() ### Description Accepts a TRoomGeometry structure containing a list of corner vertices and a list of walls (each defined by a list of vertex indices). This is the natural endpoint of the OBJ loader and allows custom convex room construction programmatically. ### Method SetupRoomGeometry ### Parameters - **geometry** (TRoomGeometry) - Required - Structure containing corner vertices and wall definitions. ### Response Returns a room object equivalent to a shoebox room once created. ``` -------------------------------- ### /control/connect Source: https://grupodiana.github.io/BRT-Documentation/osc/ Establish a connection with an IP and port. ```APIDOC ## /control/connect ### Description Establish a connection with an IP and port. ### Method OSC ### Endpoint /control/connect ``` -------------------------------- ### CSphericalFIRTable - Instantiation and Loading Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Shows how to create a CSphericalFIRTable instance and load a SOFA file into it. ```APIDOC ## CSphericalFIRTable - Instantiation and Loading ### Description Creates a CSphericalFIRTable instance and loads a SOFA file into it. ### Code Example ```cpp // Assuming SOFA_FILEPATH contains the SOFA filename including the path std::shared_ptr hrtf = std::make_shared(); bool hrtfSofaLoaded = LoadSofaFile(SOFA_FILEPATH, hrtf); if (!hrtfSofaLoaded) { // ERROR } ``` ``` -------------------------------- ### Instantiate CSDNEnvironmentModel Source: https://grupodiana.github.io/BRT-Documentation/library/environment-models/sdn-environment-model/ Shows how to create an SDN environment model using the BRT manager. Assumes the environment ID is in _environmentID. Checks for null after creation to handle errors. ```cpp // Assuming that the ID of this environment model is contained in _environmentID. brtManager.BeginSetup(); std::shared_ptr environmentModel = brtManager.CreateEnvironment(_environmentID); brtManager.EndSetup(); if (environmentModel == nullptr) { // error } ``` -------------------------------- ### Example: Configure Listener B as virtual with calibration reference Source: https://grupodiana.github.io/BRT-Documentation/osc/control/ BeRTA receives the command to configure Listener B as virtual, using Listener A as its calibration reference. The response confirms the virtual configuration. ```plaintext /control/setListenerOutput B -1 false A ``` ```plaintext /control/actionResult /control/setListenerOutput B true "Listener B configured as Virtual with A as calibration reference." ``` -------------------------------- ### Instantiate CSourceDirectivityModel Source: https://grupodiana.github.io/BRT-Documentation/library/source-models/directivity-source-model/ Creates a sound source of type CSourceDirectivityModel using the brtManager. Assumes the environment model ID is in _environmentID. Checks for null after setup. ```cpp // Assuming that the ID of this environment model is contained in _environmentID. brtManager.BeginSetup(); std::shared_ptr soundSource = brtManager->CreateSoundSource(soundSourceID); brtManager.EndSetup(); if (soundSource == nullptr) { // error } ``` -------------------------------- ### BeRTA loadFilter example messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving a loadFilter command, echoing it to subscribers, and sending an actionResult back to the sender with success or failure details. ```plaintext /resources/loadFilters EarMuffFilter resources//SOSFilters//EarMuffFilter_48Khz.sofa ``` ```plaintext /control/actionResult /resources/loadFilters EarMuffFilter true SOS filter coef. (EarMuffFilter) loaded successfully, from the file: resources//SOSFilters//EarMuffFilter_48Khz.sofa ``` ```plaintext /resources/loadSOSFilters EarMuffFilter false File path could not be found: resources//SOSFilters//EarMuffFilte11r_48Khz.sofa. ``` -------------------------------- ### /playAndRecord return confirmation Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Return confirmation format for /playAndRecord. success=true if action performed, false otherwise, with description. ```plaintext /control/actionResult /playAndRecord ``` -------------------------------- ### /recordIR Syntax Source: https://grupodiana.github.io/BRT-Documentation/osc/overall/ The command syntax for /recordIR, showing all parameters: filename, type, time, period, delay, x, y, z, directivity, and enable_directivity. ```text /recordIR ``` -------------------------------- ### BeRTA removeDirectivityTF example messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Example of BeRTA receiving a removeDirectivityTF command, echoing it to subscribers, and sending an actionResult back to the sender indicating success or failure. ```plaintext /resources/removeDirectivityTF directivityTF1 ``` ```plaintext /control/actionResult /resources/removeDirectivityTF directivityTF1 true DirectivityTF directivityTF1 removed ``` ```plaintext /control/actionResult /resources/removeDirectivityTF directivityTF1 false ERROR deleting DirectivityTF. directivityTF1 not found in the list ``` -------------------------------- ### Instantiate and connect CFIRBilateralFilterModel in C++ Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Shows how to create a binaural filter using BRTManager, connect it to a listener, and connect a listener model. Includes error checking and method calls for enabling, disabling, and setting gain. ```cpp brtManager.BeginSetup(); std::shared_ptr binauralFilter = brtManager.CreateBinauralFilter(_binauralFilterID); brtManager.EndSetup(); if (binauralFilter == nullptr) { // ERROR } std::shared_ptr listener = brtManager.GetListener(_listenerID); if (listener != nullptr) { brtManager.BeginSetup(); bool control = listener->ConnectBinauralFilter(_binauralFilterID); brtManager.EndSetup(); } std::shared_ptr binauralFilter = brtManager.GetBinauralFilter(_binauralF if (binauralFilter != nullptr) { brtManager.BeginSetup(); bool control = binauralFilter->ConnectListenerModel(_listenerModelID); brtManager.EndSetup(); } void EnableModel() void DisableModel() bool IsModelEnabled() void SetGain(float _gain) float GetGain() bool SetFIRTable(std::shared_ptr _firTable) std::shared_ptr GetFIRTable() const void RemoveFIRTable() bool ConnectListenerModel(const std::string & _listenerModelID, Common::T_ear _ear = Common::T_ear::BOTH) bool ConnectListenerModel(std::shared_ptr _listenerModel, Common::T_ear _ear = Common::T_ear::BOTH) bool DisconnectListenerModel(const std::string & _listenerModelID, Common::T_ear _ear = Common::T_ear::BOTH) bool DisconnectListenerModel(std::shared_ptr _listenerModel, Common::T_ear _ear = Common::T_ear::BOTH) T_BilateralFilterType GeBilateralFilterType() const bool IsConnectedToListener() bool IsConnectedToListenerModel() void ConnectionToListenerEstablished(const std::string & _listenerID) std::vector GetInputs() { return inputConnections; } std::vector GetOutputs() { return outputConnections; } ``` -------------------------------- ### /source/setDirectivity - Example Messages Source: https://grupodiana.github.io/BRT-Documentation/osc/source/ Example OSC messages for /source/setDirectivity. The first is echoed to all subscribers except the sender; the second is the action result sent back to the sender. ```plaintext /source/setDirectivity source1 Directivity1 ``` ```plaintext /control/actionResult /source/setDirectivity Directivity1 true setDirectivity: Directivity1 has been set to SoundSource: source1 ``` -------------------------------- ### Example: /listener/enableITD command messages Source: https://grupodiana.github.io/BRT-Documentation/assets/brt-documentation.pdf Shows the messages exchanged when using the /listener/enableITD command. BeRTA echoes the command to all subscribers except the sender, and sends an actionResult back to the sender with a description. ```plaintext /listener/enableITD DefaultListener true ``` ```plaintext /control/actionResult /listener/enableITD DefaultListener true "ITD enabled to DefaultListener" ```