AkAudioInputManager.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. #pragma once
  16. #include "AkInclude.h"
  17. #include "AkAudioDevice.h"
  18. #include "Templates/Function.h"
  19. /*------------------------------------------------------------------------------------
  20. AkAudioInput Delegates
  21. ------------------------------------------------------------------------------------*/
  22. DECLARE_DELEGATE_RetVal_ThreeParams(bool, FAkGlobalAudioInputDelegate, uint32, uint32, float**);
  23. DECLARE_DELEGATE_OneParam(FAkGlobalAudioFormatDelegate, AkAudioFormat&);
  24. /*------------------------------------------------------------------------------------
  25. FAkAudioInputManager
  26. ------------------------------------------------------------------------------------*/
  27. class AKAUDIO_API FAkAudioInputManager
  28. {
  29. public:
  30. /**
  31. * Post an Input event to Wwise SoundEngine linked to an actor
  32. *
  33. * @param Event Event to post
  34. * @param Actor Actor on which to play the event
  35. * @param AudioSamplesDelegate Callback that fills the audio samples buffer
  36. * @param AudioFormatDelegate Callback that sets the audio format
  37. * @param AudioContext Context where this input is used (Editor, Player, or other)
  38. * @return ID assigned by Wwise SoundEngine
  39. */
  40. static AkPlayingID PostAudioInputEvent(
  41. UAkAudioEvent* Event,
  42. AActor* Actor,
  43. FAkGlobalAudioInputDelegate AudioSamplesDelegate,
  44. FAkGlobalAudioFormatDelegate AudioFormatDelegate,
  45. EAkAudioContext AudioContext = EAkAudioContext::Foreign
  46. );
  47. /**
  48. * Post an Input event to Wwise SoundEngine linked to a Component
  49. *
  50. * @param Event Event to post
  51. * @param Component Component on which to play the event
  52. * @param AudioSamplesDelegate Callback that fills the audio samples buffer
  53. * @param AudioFormatDelegate Callback that sets the audio format
  54. * @param AudioContext Context where this input is used (Editor, Player, or other)
  55. * @return ID assigned by Wwise SoundEngine
  56. */
  57. static AkPlayingID PostAudioInputEvent(
  58. UAkAudioEvent* Event,
  59. UAkComponent* Component,
  60. FAkGlobalAudioInputDelegate AudioSamplesDelegate,
  61. FAkGlobalAudioFormatDelegate AudioFormatDelegate,
  62. EAkAudioContext AudioContext = EAkAudioContext::Foreign
  63. );
  64. /**
  65. * Post an Input event to Wwise SoundEngine linked to a GameObject
  66. *
  67. * @param Event Event to post
  68. * @param GameObject GameObject on which to play the event
  69. * @param AudioSamplesDelegate Callback that fills the audio samples buffer
  70. * @param AudioFormatDelegate Callback that sets the audio format
  71. * @param AudioContext Context where this input is used (Editor, Player, or other)
  72. * @return ID assigned by Wwise SoundEngine
  73. */
  74. static AkPlayingID PostAudioInputEvent(
  75. UAkAudioEvent* Event,
  76. AkGameObjectID GameObject,
  77. FAkGlobalAudioInputDelegate AudioSamplesDelegate,
  78. FAkGlobalAudioFormatDelegate AudioFormatDelegate,
  79. EAkAudioContext AudioContext = EAkAudioContext::Foreign
  80. );
  81. /**
  82. * Post an Input event to Wwise SoundEngine not linked to any GameObject
  83. *
  84. * @param Event Event to post
  85. * @param AudioSamplesDelegate Callback that fills the audio samples buffer
  86. * @param AudioFormatDelegate Callback that sets the audio format
  87. * @param AudioContext Context where this input is used (Editor, Player, or other)
  88. * @return ID assigned by Wwise SoundEngine
  89. */
  90. static AkPlayingID PostAudioInputEvent(
  91. UAkAudioEvent* Event,
  92. FAkGlobalAudioInputDelegate AudioSamplesDelegate,
  93. FAkGlobalAudioFormatDelegate AudioFormatDelegate,
  94. EAkAudioContext AudioContext = EAkAudioContext::Foreign
  95. );
  96. };