Guest User

VoiceRecordTest.h

a guest
Dec 28th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.90 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #pragma once
  4.  
  5. #include "GameFramework/Actor.h"
  6. #include "Voice.h"
  7. #include "FileManager.h"
  8. #include "FileManager.h"
  9. #include "OnlineSubsystemUtils.h"
  10. #include "Sound/SoundWaveProcedural.h"
  11. #include "Serialization/Archive.h"
  12. #include "VoiceRecordTest.generated.h"
  13.  
  14. UCLASS()
  15. class VIZGAME_API AVoiceRecordTest : public AActor
  16. {
  17.     GENERATED_BODY()
  18.    
  19. public:
  20.     // Sets default values for this actor's properties
  21.     AVoiceRecordTest();
  22.  
  23.     // Called when the game starts or when spawned
  24.     virtual void BeginPlay() override;
  25.    
  26.     // Called every frame
  27.     virtual void Tick( float DeltaSeconds ) override;
  28.  
  29.     UPROPERTY()
  30.         float VoiceCaptureVolume;
  31.  
  32.     UPROPERTY()
  33.         bool VoiceCaptureTest;
  34.     UPROPERTY()
  35.         bool PlayVoiceCaptureFlag;
  36.  
  37.     UPROPERTY()
  38.         FTimerHandle VoiceCaptureTickTimer;
  39.     UPROPERTY()
  40.         FTimerHandle PlayVoiceCaptureTimer;
  41.  
  42.     TSharedPtr<class IVoiceCapture> VoiceCapture;
  43.  
  44.     UPROPERTY()
  45.         USoundWaveProcedural* VoiceCaptureSoundWaveProcedural;
  46.  
  47.     UPROPERTY()
  48.         USoundWaveProcedural* VoiceCaptureSoundWaveProcedural_ONE;
  49.  
  50.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Voice Recording")
  51.         UAudioComponent* VoiceCaptureAudioComponent;
  52.  
  53.     UPROPERTY()
  54.         TArray<uint8> VoiceCaptureBuffer; //voice data is saved here
  55.  
  56.     UPROPERTY()
  57.         TArray<uint8> DataTakenFromBinary; //retrieved from binry
  58.  
  59.     UFUNCTION()
  60.         void    VoiceCaptureTick(); //Called every tick when we want to record
  61.  
  62.     UFUNCTION(BlueprintCallable, Category = "Voice Recording")
  63.         void StartRecording();
  64.  
  65.     UFUNCTION(BlueprintCallable, Category = "Voice Recording")
  66.         void StopAndSaveRecording();
  67.  
  68.     UFUNCTION(BlueprintCallable, Category = "Voice Recording")
  69.         void LoadFromBinaryAndPlay();
  70.  
  71.     bool StartRecord;
  72.  
  73. };
Add Comment
Please, Sign In to add comment