Hi, I am working on an online speech chat.
I use IVoiceCapture to capture the voice data from the microphone and save the voice data to file.
Then when i want to use the data, i use FFileHelper to load the file to an uint8 array(TArray).
If i use the data array on the server, it works correctly.
But if i pass the data array to server and multicast it, it not works.
Please help me!
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
class USoundWaveProcedural* VoiceCaptureSoundWaveProcedural;
UPROPERTY()
class UAudioComponent* VoiceCaptureAudioComponent;
void UVoiceCaptureComponent::PlaybackFromBytes(const TArray<uint8>& Buffer)
{
if (Buffer.Num() > 0)
{
UE_LOG(VoiceCaptureLog, Warning, TEXT("PlaybackFromBytes(): Start playback..."));
VoiceCaptureSoundWaveProcedural->QueueAudio(Buffer.GetData(), Buffer.Num());
VoiceCaptureAudioComponent->SetSound(VoiceCaptureSoundWaveProcedural);
VoiceCaptureAudioComponent->Play();
}
else
{
UE_LOG(VoiceCaptureLog, Warning, TEXT("PlaybackFromBytes(): The given buffer is invalid..."));
}
}