Skip to content
Snippets Groups Projects
Commit bcf588c3 authored by Lab1's avatar Lab1
Browse files

Merge branch '4.26' into feature/va_launcher_with_reproduction_selection

parents e6b6d7b5 91536aa7
Branches
No related tags found
1 merge request!9VAServerLauncher Improvement (now also sending reproduction type and ini)
......@@ -5,21 +5,22 @@ This Plugin allows the user to use the [VA Server](http://www.virtualacoustics.o
# Installation
To install the Plugin, clone the repository into the "Plugins" folder of your Unreal Engine 4 Project. Moreover make sure to have the VA Server prepared.
The Server can either be used in its original form ([Link](http://www.virtualacoustics.org/)) or with the especially for this Plugin optimized Python Connection script ([Link](https://devhub.vr.rwth-aachen.de/VR-Group/vaserver), Recommended).
Using the Version with the Python script has the adventage of not needing to Restart the Server all the time manually and make sure to follow the instructions which are currently in its Readme file.
The Server can either be used in its original form ([Link](http://www.virtualacoustics.org/)) or with the especially for this Plugin optimized Python [VA Server Launcher](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/vaserverlauncher) script (Recommended).
Using the Version with the Python script has the advantage of not needing to Restart the Server all the time manually and make sure to follow the instructions which are currently in its Readme file.
Furthermore the Server Launcher Script can transfer used audio files from you Unreal project to the VAServer, so you don't have to do this manually.
If you are using the automatic VAServer launching either have VAServer cloned out next to the folder of your project or specify the VALauncher Path in the Engine/Virtual Acoustics(VA) section of the project settings.
The Plugin requires to have the [nDisplayExtensions](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/ndisplayextensions) installed.
The Plugin requires to have the [RWTH VR Toolkit](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit) installed.
## Usage
For a more detailed C++ / Blueprint usage and a Documentation of the Plugins public functions, please check out the matching wiki page for each public Class and Enum:
* [VAReceiverActor](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-va-plugin/-/wikis/Documentation/VAReceiverActor)
* [VAReceiverActor](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Documentation/VAReceiverActor)
* Actor handling the Connection and Scene Settings for the current world, as well as the Position updates for the Receiver. If there is no Receiver Actor placed in the Scene, there will be created a new one with Default values at Runtime.
* [VAReflectionWall](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-va-plugin/-/wikis/Documentation/VAReflectionWall)
* [VAReflectionWall](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Documentation/VAReflectionWall)
* Actor representing a wall on which the Sound Sources should reflect on. Make sure that its shape alligns with the wall. Please make sure to use symmetrical Directivities for the Sound Sources due to the fact that the directivities cannot be mirrored among the wall.
* [VASoundSourceComponent](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-va-plugin/-/wikis/Documentation/VASoundSourceComponent)
* [VASoundSourceComponent](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Documentation/VASoundSourceComponent)
* Actor Component representing a Sound Source. Has to be attatched to something. It can have a graphical representation and reflecitons, which can be created with the Reflection Walls
* [VAEnums](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-va-plugin/-/wikis/Documentation/VAEnmus)
* [VAEnums](https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Documentation/VAEnmus)
* All Enums used within the Plugin. At current state, only the EPlayAction is used for the Interface functions
\ No newline at end of file
// Fill out your copyright notice in the Description page of Project Settings.
#include "SignalSources/VAAudioInputSignalSource.h"
#include "VAUtils.h"
#include "VAPlugin.h"
void UVAAudioInputSignalSource::Initialize()
{
if (bInitialized)
{
FVAUtils::LogStuff("[UVAAudioInputSignalSource::Initialize()]: Signal source is already initialized, aborting...", true);
return;
}
ID = FVAPlugin::GetAudioInputSignalSourceID(Channel);
if (!IsValidID(ID))
{
FVAUtils::LogStuff("[UVAAudioInputSignalSource::Initialize()]: Error initializing Audio Input Signal Source", true);
return;
}
bInitialized = true;
}
// Fill out your copyright notice in the Description page of Project Settings.
#include "SoundSource/VAAudioInputSourceComponent.h"
#include "SignalSources/VAAudioInputSignalSource.h"
UVAAudioInputSourceComponent::UVAAudioInputSourceComponent() : Super()
{
SignalSource = CreateDefaultSubobject<UVAAudioInputSignalSource>("AudioInputSignalSource");
}
......@@ -560,6 +560,25 @@ bool FVAPlugin::SetSignalSourceBufferLooping(const std::string& SignalSourceID,
}
}
std::string FVAPlugin::GetAudioInputSignalSourceID(const int Channel)
{
if (!ShouldInteractWithServer())
return VA_SLAVE_ID_STRING;
const std::string SignalSourceID = "audioinput" + std::to_string(Channel);
//TODO: Check if signal source really exist, otherwise return invalid ID
//PSC: I was trying to use CVASignalSourceInfo for that. But when the local variable is destroyed, the program crashes.
//std::vector<CVASignalSourceInfo> Infos;
//VAServer->GetSignalSourceInfos(Infos);
//CVASignalSourceInfo Info = VAServer->GetSignalSourceInfo(SignalSourceID);
//if (false)
// return VA_INVALID_ID_STRING;
return SignalSourceID;
}
std::string FVAPlugin::CreateSignalSourcePrototype(UVAAbstractSignalSource* SignalSource)
{
if (!ShouldInteractWithServer())
......
......@@ -76,6 +76,9 @@ public:
static bool SetSignalSourceBufferPlaybackPosition(const std::string& SignalSourceID, float Time);
static bool SetSignalSourceBufferLooping(const std::string& SignalSourceID, bool bLoop);
// Returns the ID of the signal source referring the given audio input channel. Invalid ID, if channel does not exist
static std::string GetAudioInputSignalSourceID(const int Channel);
static std::string CreateSignalSourcePrototype(UVAAbstractSignalSource* SignalSource);
// Deletes a signal source with given ID. Use with great care!
static bool DeleteSignalSource(const std::string& SignalSourceID);
......
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "SignalSources/VAAbstractSignalSource.h"
#include "VAAudioInputSignalSource.generated.h"
/**
*
*/
UCLASS(ClassGroup = (VA))
class VAPLUGIN_API UVAAudioInputSignalSource : public UVAAbstractSignalSource
{
GENERATED_BODY()
protected:
// Input channel used to stream into signal source
UPROPERTY(EditAnywhere, meta = (DisplayName = "Input Channel ID", Category = "Audio Input", ClampMin = "1"))
int Channel = 1;
public:
UVAAudioInputSignalSource() = default;
// Creates the signal source in VA and sets the ID accordingly
void Initialize() override;
};
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "VAAudioInputSourceComponent.generated.h"
/**
*
*/
UCLASS(ClassGroup = (VA), meta = (BlueprintSpawnableComponent))
class VAPLUGIN_API UVAAudioInputSourceComponent : public UVAAbstractSourceComponent
{
GENERATED_BODY()
public:
UVAAudioInputSourceComponent();
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment