7#include "CoreMinimal.h"
9#include "AudioCapture.h"
10#include "Components/ActorComponent.h"
11#include "UVoiceConversationSystem.generated.h"
13UCLASS(Blueprintable, BlueprintType, ClassGroup=(Voice), meta=(BlueprintSpawnableComponent))
14class ONEPIECE_API UVoiceConversationSystem :
public UActorComponent
20 UVoiceConversationSystem();
24 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
32 UFUNCTION(BlueprintCallable, Category = "Voice|Conversation")
33 void StartRecording();
36 UFUNCTION(BlueprintCallable, Category = "Voice|Conversation")
42 UFUNCTION(BlueprintCallable, Category = "Voice|Conversation")
43 bool PlayVoiceAudio(const TArray<uint8>& AudioData);
47 void OnVoiceAudioFinished();
50 UFUNCTION(BlueprintPure, Category = "Voice|Conversation")
51 bool IsRecording()
const {
return bIsRecording; }
59 void HandleOnCapture(
const float* InAudio, int32 InNumFrames, int32 InNumChannels, int32 InSampleRate);
75 TUniquePtr<Audio::FAudioCapture> AudioCapture;
77 TArray<uint8> WAVData;
78 TArray<uint8> PCMData;
80 int32 LastSampleRate = 16000;
81 int32 LastNumChannels = 1;
82 FString LastRecordedFilePath;
85 bool bIsRecording = false;
86 bool bIsProcessing = false;
90 TObjectPtr<class UAudioComponent> CurVoiceAudio;
93 FTimerHandle VoiceFinishTimerHandle;
네트워크 요청과 응답에 사용되는 구조체 및 설정을 정의합니다.
Main character driven directly by the player.
게임 내 전역 이벤트를 중계하는 중앙 이벤트 버스(Event Bus) 서브시스템입니다.
Speaking Questions 응답 구조체입니다.