No I don’t receive any warnings in this regard. I uploaded the project, I hope .zip files are not a problem for you
It contains the VS Project, the compiled plugin with .js styling and an example file. I also print out a little to the log. I think of interest for you are only the main files as they contain the FMOD stuff. Thank you for checking it out.
Btw., I noticed the AudioMotors 2 plugin has the same issue as my plugin.
Edit.: My problem is finding the plugin. This kind of plugin is on a Channel, not a DSPConnection or a ChannelGroup right? I tried Dsp Inputs, Outputs, i searched all channels, sounds and connections but it is nowhere to be found. It’s a miracle to me.
Oh almost forgot. Here the code to check find the DSP. The event is just the plugin on a single track on a 3d timeline.
header file
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "FMODAudioComponent.h"
#include "EngineTest.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class GINSUTEST_API UEngineTest : public USceneComponent
{
GENERATED_BODY()
public:
UEngineTest();
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(EditAnywhere)
class UFMODEvent* Event;
UPROPERTY()
class UFMODAudioComponent* AudioComp;
protected:
void ExtractGroup(FMOD::ChannelGroup* Group);
void ExtractChannel(FMOD::Channel* Channel);
void ExtractDSPs(FMOD::ChannelControl* ChannelControl);
void ExtractSounds(FMOD::Channel* Channel);
void GetDSPProperties(FMOD::DSP* DSP);
};
source file
// Fill out your copyright notice in the Description page of Project Settings.
#include "EngineTest.h"
UEngineTest::UEngineTest()
{
PrimaryComponentTick.bCanEverTick = true;
}
void UEngineTest::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (AudioComp == nullptr) {
FAttachmentTransformRules AttachmentRules
(
EAttachmentRule::SnapToTarget,
EAttachmentRule::SnapToTarget,
EAttachmentRule::KeepRelative,
true
);
AudioComp = NewObject<UFMODAudioComponent>(this, UFMODAudioComponent::StaticClass());
AudioComp->RegisterComponent();
AudioComp->AttachToComponent(GetOwner()->GetRootComponent(), AttachmentRules);
AudioComp->SetEvent(Event);
AudioComp->Play();
AudioComp->SetParameter(TEXT("Rpm"), 1500.0f);
}
const FMOD::Studio::EventInstance* Instance = AudioComp->StudioInstance;
if (Instance == nullptr) return;
FMOD_STUDIO_PLAYBACK_STATE PlaybackState;
FMOD_RESULT Result = Instance->getPlaybackState(&PlaybackState);
if (Result != FMOD_OK || PlaybackState != FMOD_STUDIO_PLAYBACK_PLAYING) return;
FMOD::ChannelGroup* ChannelGroup;
Result = Instance->getChannelGroup(&ChannelGroup);
if (Result != FMOD_OK) return;
ExtractGroup(ChannelGroup);
}
void UEngineTest::ExtractGroup(FMOD::ChannelGroup* Group)
{
FMOD_RESULT Result;
//ExtractDSPs(Group);
int32 NumChannels = 0;
Result = Group->getNumChannels(&NumChannels);
if (Result == FMOD_OK)
{
for (int32 i = 0; i < NumChannels; ++i)
{
FMOD::Channel* Channel;
Result = Group->getChannel(i, &Channel);
if (Result != FMOD_OK) continue;
ExtractChannel(Channel);
}
}
int32 NumGroups = 0;
Result = Group->getNumGroups(&NumGroups);
if (Result == FMOD_OK)
{
for (int32 i = 0; i < NumGroups; ++i)
{
FMOD::ChannelGroup* SubGroup;
Result = Group->getGroup(i, &SubGroup);
if (Result != FMOD_OK) continue;
ExtractGroup(SubGroup);
}
}
}
void UEngineTest::ExtractChannel(FMOD::Channel* Channel)
{
ExtractDSPs(Channel);
ExtractSounds(Channel);
}
void UEngineTest::ExtractDSPs(FMOD::ChannelControl* ChannelControl)
{
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::White, FString::Printf(TEXT("DSP")));
int32 NumDSPs = 0;
FMOD_RESULT Result = ChannelControl->getNumDSPs(&NumDSPs);
if (Result == FMOD_OK)
{
for (int32 i = 0; i < NumDSPs; ++i)
{
FMOD::DSP* DSP;
Result = ChannelControl->getDSP(i, &DSP);
if (Result != FMOD_OK) continue;
GetDSPProperties(DSP);
}
}
}
void UEngineTest::ExtractSounds(FMOD::Channel* Channel)
{
FMOD::Sound* Sound;
FMOD_RESULT Result = Channel->getCurrentSound(&Sound);
if (Result != FMOD_OK) return;
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::White, FString::Printf(TEXT("Found a sound")));
}
void UEngineTest::GetDSPProperties(FMOD::DSP* DSP)
{
char name[50];
uint32* Version = 0;
int32 Channels = 0, ConfigWidth = 0, ConfigHeight = 0;
FMOD_RESULT Result = DSP->getInfo(name, Version, &Channels, &ConfigWidth, &ConfigHeight);
if (Result != FMOD_OK) return;
const FString DSPName(name);
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::White, FString::Printf(TEXT("%s"), *DSPName));
int32 NumInputs;
Result = DSP->getNumInputs(&NumInputs);
if (Result == FMOD_OK && NumInputs > 0)
{
for (int32 i = 0; i < NumInputs; ++i)
{
FMOD::DSP* InDSP;
FMOD::DSPConnection* DSPConnection;
Result = DSP->getInput(i, &InDSP, &DSPConnection);
if (Result == FMOD_OK)
{
Result = DSPConnection->getInput(&InDSP);
if (Result != FMOD_OK) continue;
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::White, FString::Printf(TEXT("DSPConnection")));
GetDSPProperties(InDSP);
}
}
}
}
There is one sound found, i dont know why. But calling any method on it fails. Get name fails with FMOD_ERR_INVALID_HANDLE.