AkMacSoundEngine.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. // AkMacSoundEngine.h
  21. /// \file
  22. /// Main Sound Engine interface, specific Mac.
  23. #ifndef _AK_MAC_SOUND_ENGINE_H_
  24. #define _AK_MAC_SOUND_ENGINE_H_
  25. #include <AK/SoundEngine/Common/AkTypes.h>
  26. #include <AK/Tools/Common/AkPlatformFuncs.h>
  27. ///< API used for audio output
  28. ///< Use with AkPlatformInitSettings to select the API used for audio output. The selected API may be ignored if the device does not support it.
  29. ///< Use AkAPI_Default, it will select the more appropriate API depending on the device's capabilities. Other values should be used for testing purposes.
  30. ///< \sa AK::SoundEngine::Init
  31. typedef enum AkAudioAPIMac
  32. {
  33. AkAudioAPI_AVAudioEngine = 1 << 0, ///< Use AVFoundation framework (modern, has more capabilities, available only for macOS 10.15 or above)
  34. AkAudioAPI_AudioUnit = 1 << 1, ///< Use AudioUnit framework (basic functionality, compatible with all macOS devices)
  35. AkAudioAPI_Default = AkAudioAPI_AVAudioEngine | AkAudioAPI_AudioUnit, ///< Default value, will select the more appropriate API (AVAudioEngine for compatible devices, AudioUnit for others)
  36. } AkAudioAPI;
  37. /// Platform specific initialization settings
  38. /// \sa AK::SoundEngine::Init
  39. /// \sa AK::SoundEngine::GetDefaultPlatformInitSettings
  40. struct AkPlatformInitSettings
  41. {
  42. // Threading model.
  43. AkThreadProperties threadLEngine; ///< Lower engine threading properties
  44. AkThreadProperties threadOutputMgr; ///< Ouput thread threading properties
  45. AkThreadProperties threadBankManager; ///< Bank manager threading properties (its default priority is AK_THREAD_PRIORITY_NORMAL)
  46. AkThreadProperties threadMonitor; ///< Monitor threading properties (its default priority is AK_THREAD_PRIORITY_ABOVENORMAL). This parameter is not used in Release build.
  47. AkUInt32 uSampleRate; ///< Sampling Rate. Default 48000 Hz
  48. // Voices.
  49. AkUInt16 uNumRefillsInVoice; ///< Number of refill buffers in voice buffer. 2 == double-buffered, defaults to 4.
  50. AkAudioAPI eAudioAPI; ///< Main audio API to use. Leave to AkAPI_Default for the default sink (default value).
  51. ///< \ref AkAudioAPI
  52. AkUInt32 uNumSpatialAudioPointSources; ///< Number of Apple Spatial Audio point sources to allocate for 3D audio use (each point source is a system audio object). Default: 128
  53. bool bVerboseSystemOutput; ///< Print detailed system output information to the console log
  54. };
  55. namespace AK
  56. {
  57. namespace SoundEngine
  58. {
  59. /// Get the motion device ID corresponding to a GCController player index. This device ID can be used to add/remove motion output for that gamepad.
  60. /// The player index is 0-based, and corresponds to a value of type GCControllerPlayerIndex in the Core.Haptics framework.
  61. /// \note The ID returned is unique to Wwise and does not correspond to any sensible value outside of Wwise.
  62. /// \return Unique device ID
  63. AK_EXTERNAPIFUNC(AkDeviceID, GetDeviceIDFromPlayerIndex) (int playerIndex);
  64. }
  65. }
  66. #endif //_AK_MAC_SOUND_ENGINE_H_