AkAudioInputComponent.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. /*=============================================================================
  16. UAkAudioInputComponent.h:
  17. =============================================================================*/
  18. #pragma once
  19. #include "AkAudioInputManager.h"
  20. #include "AkInclude.h"
  21. #include "AkComponent.h"
  22. #include "AkAudioInputComponent.generated.h"
  23. /*------------------------------------------------------------------------------------
  24. UAkAudioInputComponent
  25. ------------------------------------------------------------------------------------*/
  26. UCLASS(ClassGroup = Audiokinetic, abstract, BlueprintType, hidecategories = (Transform, Rendering, Mobility, LOD, Component, Activation), meta = (BlueprintSpawnableComponent))
  27. class AKAUDIO_API UAkAudioInputComponent : public UAkComponent
  28. {
  29. GENERATED_BODY()
  30. public:
  31. UAkAudioInputComponent(const class FObjectInitializer& ObjectInitializer);
  32. /**
  33. * Posts this component's AkAudioEvent to Wwise along with associated AudioSamples callback and AudioFormat callback, using this component as the game object source
  34. *
  35. */
  36. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkAudioInputComponent")
  37. virtual int32 PostAssociatedAudioInputEvent();
  38. protected:
  39. /** This is called after the GameObject that owns this component is unregistered from the Wwise sound engine. */
  40. virtual void PostUnregisterGameObject() override;
  41. /** The audio callback. This will be called continuously by the Wwise sound engine,
  42. * and is used to provide the sound engine with audio samples. If this function returns false, the audio
  43. * input event will be stopped and the function will stop being called.
  44. */
  45. virtual bool FillSamplesBuffer(uint32 NumChannels, uint32 NumSamples, float** BufferToFill) PURE_VIRTUAL(AkAudioInputComponent::FillSamplesBuffer, return false;);
  46. /** This callback is used to provide the Wwise sound engine with the required audio format. */
  47. virtual void GetChannelConfig(AkAudioFormat& AudioFormat) PURE_VIRTUAL(UAkAudioInputComponent::GetChannelConfig,);
  48. TArray<AkPlayingID> CurrentlyPlayingIDs;
  49. private:
  50. FAkGlobalAudioInputDelegate AudioInputDelegate;
  51. FAkGlobalAudioFormatDelegate AudioFormatDelegate;
  52. };