AkAudioInputPlugin.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*******************************************************************************
  2. The content of this file includes portions of the AUDIOKINETIC Wwise Technology
  3. released in source code form as part of the SDK installer package.
  4. Commercial License Usage
  5. Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
  6. may use this file in accordance with the end user license agreement provided
  7. with the software or, alternatively, in accordance with the terms contained in a
  8. written agreement between you and Audiokinetic Inc.
  9. Apache License Usage
  10. Alternatively, this file may be used under the Apache License, Version 2.0 (the
  11. "Apache License"); you may not use this file except in compliance with the
  12. Apache License. You may obtain a copy of the Apache License at
  13. http://www.apache.org/licenses/LICENSE-2.0.
  14. Unless required by applicable law or agreed to in writing, software distributed
  15. under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  16. OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
  17. the specific language governing permissions and limitations under the License.
  18. Copyright (c) 2023 Audiokinetic Inc.
  19. *******************************************************************************/
  20. /// \file
  21. ///! Definition of callbacks used for the Audio Input Plugin
  22. /// <br><b>Wwise source name:</b> AudioInput
  23. /// <br><b>Library file:</b> AkAudioInputSource.lib
  24. #pragma once
  25. #define AKSOURCEID_AUDIOINPUT 200
  26. ////////////////////////////////////////////////////////////////////////////////////////////
  27. // API external to the plug-in, to be used by the game.
  28. /// Callback requesting for the AkAudioFormat to use for the plug-in instance.
  29. /// Refer to the Source Input plugin documentation to learn more about the valid formats.
  30. /// \sa \ref soundengine_plugins_source
  31. AK_CALLBACK(void, AkAudioInputPluginGetFormatCallbackFunc)(
  32. AkPlayingID in_playingID, ///< Playing ID (same that was returned from the PostEvent call).
  33. AkAudioFormat& io_AudioFormat ///< Already filled format, modify it if required.
  34. );
  35. /// Function that returns the Gain to be applied to the Input Plugin.
  36. /// [0..1] range where 1 is maximum volume.
  37. AK_CALLBACK(AkReal32, AkAudioInputPluginGetGainCallbackFunc)(
  38. AkPlayingID in_playingID ///< Playing ID (same that was returned from the PostEvent call).
  39. );
  40. /// Callback requesting for new data for playback.
  41. /// \param in_playingID Playing ID (same that was returned from the PostEvent call)
  42. /// \param io_pBufferOut Buffer to fill
  43. /// \remarks See IntegrationDemo sample for a sample on how to implement it.
  44. AK_CALLBACK(void, AkAudioInputPluginExecuteCallbackFunc)(
  45. AkPlayingID in_playingID,
  46. AkAudioBuffer* io_pBufferOut
  47. );
  48. /// This function should be called at the same place the AudioInput plug-in is being registered.
  49. AK_EXTERNAPIFUNC(void, SetAudioInputCallbacks)(
  50. AkAudioInputPluginExecuteCallbackFunc in_pfnExecCallback,
  51. AkAudioInputPluginGetFormatCallbackFunc in_pfnGetFormatCallback = NULL, // Optional
  52. AkAudioInputPluginGetGainCallbackFunc in_pfnGetGainCallback = NULL // Optional
  53. );
  54. ////////////////////////////////////////////////////////////////////////////////////////////