cancel
Showing results for 
Search instead for 
Did you mean: 

"Resolving Audio Processing Error: How to Fix Error Code -2202 in LipSync Library?"

zw.1986
Explorer
I am currently using C++ to implement LipSync Library to convert WAV audio files, but after running Unreal 4.23, this error is displayed in the LOG. I want to know which part is wrong with this error. Here is the C++ function code I use to convert WAV files: void AAudioCaptureActor::GenerateLipSyncSequence(USoundWave* LoadedSoundWave)
{
if (LoadedSoundWave)
{
FByteBulkData* RawWaveData = &LoadedSoundWave->RawData;
int32 RawDataSize = RawWaveData->GetElementCount();
const int32 WavHeaderSize = 44; // WAV header size
 
if (RawDataSize <= WavHeaderSize)
{
UE_LOG(LogTemp, Error, TEXT("WAV data is too short to contain a valid header."));
return;
}
 
int32 AudioDataSize = RawDataSize - WavHeaderSize;
int32 SampleCount = AudioDataSize / sizeof(int16_t);
 
const int16_t* AudioDataPtr = reinterpret_cast<const int16_t*>(reinterpret_cast<const uint8*>(RawWaveData->LockReadOnly()) + WavHeaderSize);
 
 
if (LipSyncContext.IsValid())
{
TArray<float> Visemes;
Visemes.SetNumZeroed(ovrLipSyncViseme_Count);
float LaughterScore = 0.0f;
int32_t FrameDelay = 0;
 
LipSyncContext->ProcessFrame(AudioDataPtr, SampleCount, Visemes, LaughterScore, FrameDelay, false);
 
RawWaveData->Unlock();
 
// Handle Visemes...
}
else
{
UE_LOG(LogTemp, Error, TEXT("LipSyncContext is not valid."));
}
}
else
{
UE_LOG(LogTemp, Error, TEXT("LoadedSoundWave is null."));
}
}
0 REPLIES 0