Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "GameFramework/Actor.h"
- #include "Voice.h"
- #include "FileManager.h"
- #include "FileManager.h"
- #include "OnlineSubsystemUtils.h"
- #include "Sound/SoundWaveProcedural.h"
- #include "Serialization/Archive.h"
- #include "VoiceRecordTest.generated.h"
- UCLASS()
- class VIZGAME_API AVoiceRecordTest : public AActor
- {
- GENERATED_BODY()
- public:
- // Sets default values for this actor's properties
- AVoiceRecordTest();
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- // Called every frame
- virtual void Tick( float DeltaSeconds ) override;
- UPROPERTY()
- float VoiceCaptureVolume;
- UPROPERTY()
- bool VoiceCaptureTest;
- UPROPERTY()
- bool PlayVoiceCaptureFlag;
- UPROPERTY()
- FTimerHandle VoiceCaptureTickTimer;
- UPROPERTY()
- FTimerHandle PlayVoiceCaptureTimer;
- TSharedPtr<class IVoiceCapture> VoiceCapture;
- UPROPERTY()
- USoundWaveProcedural* VoiceCaptureSoundWaveProcedural;
- UPROPERTY()
- USoundWaveProcedural* VoiceCaptureSoundWaveProcedural_ONE;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Voice Recording")
- UAudioComponent* VoiceCaptureAudioComponent;
- UPROPERTY()
- TArray<uint8> VoiceCaptureBuffer; //voice data is saved here
- UPROPERTY()
- TArray<uint8> DataTakenFromBinary; //retrieved from binry
- UFUNCTION()
- void VoiceCaptureTick(); //Called every tick when we want to record
- UFUNCTION(BlueprintCallable, Category = "Voice Recording")
- void StartRecording();
- UFUNCTION(BlueprintCallable, Category = "Voice Recording")
- void StopAndSaveRecording();
- UFUNCTION(BlueprintCallable, Category = "Voice Recording")
- void LoadFromBinaryAndPlay();
- bool StartRecord;
- };
Add Comment
Please, Sign In to add comment