Writing a blueprint node that calls the USoundVisualizationStatics::GetAmplitude function. Cant seem to figure out why its not compiling correctly.
CompilerResultsLog:
E:\unreal\projects\Realtime\Dance\Test\Source\Test\Dance.cpp(34)
: error C2665:
‘USoundVisualizationStatics::GetAmplitude’:
none of the 2 overloads could convert
all the argument types
CompilerResultsLog:
E:\unreal\EngineVersion\UE_421_Gameworks\Engine\Plugins\Runtime\SoundVisualizations\Source\SoundVisualizations\Classes\SoundVisualizationStatics.h(41):
note: could be ‘void
USoundVisualizationStatics::GetAmplitude(USoundWave
*,int32,float,float,int32,TArray
&)’ CompilerResultsLog:
E:\unreal\EngineVersion\UE_421_Gameworks\Engine\Plugins\Runtime\SoundVisualizations\Source\SoundVisualizations\Classes\SoundVisualizationStatics.h(30):
note: or ‘void
USoundVisualizationStatics::GetAmplitude(USoundWave
*,const bool,const float,const float,const
int32,TArray,FDefaultAllocator>
&)’ CompilerResultsLog:
E:\unreal\projects\Realtime\Dance\Test\Source\Test\Dance.cpp(34):
note: while trying to match the
argument list ‘(UDance::USoundWave *,
int32, float, float, int32,
TArray)’
here is my code:
void UDance::DrawSoundLines(bool Draw, bool Amp, bool L_R, float TimeLength, USoundWave* SoundWave, float Thickness, float Duration,
int32 Width, float VisDelay, TArray<FVector> CylinderLocationsL, TArray<FVector> CylinderLocationsR, TArray<float>& OutSpectrum)
{
if (SoundWave != nullptr) return;
TArray<float> OutputVals;
float GameTime = UGameplayStatics::GetTimeSeconds(GEngine->GetWorld());
float StartTime = FMath::Clamp((GameTime + VisDelay), 0.0f, 100000000.0f);
// Set audio Channel and Location
int32 Channel = 1;
TArray<FVector> ReturnLocation = CylinderLocationsL;
if (L_R)
{
Channel = 2;
ReturnLocation = CylinderLocationsR;
}
if (SoundWave != nullptr)
{
//Audio Calculation Type
if (Amp) { USoundVisualizationStatics::GetAmplitude(SoundWave,Channel,StartTime,TimeLength,Width,OutputVals); }
}
}