WwiseSoundEngineUtils.cpp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. #include "Wwise/WwiseSoundEngineUtils.h"
  16. #include "WwiseDefines.h"
  17. namespace WwiseUnrealHelper
  18. {
  19. const TCHAR* GetResultString(AKRESULT InResult)
  20. {
  21. switch (InResult)
  22. {
  23. case AK_NotImplemented: return TEXT("This feature is not implemented.");
  24. case AK_Success: return TEXT("The operation was successful.");
  25. case AK_Fail: return TEXT("The operation failed.");
  26. case AK_PartialSuccess: return TEXT("The operation succeeded partially.");
  27. case AK_NotCompatible: return TEXT("Incompatible formats");
  28. case AK_AlreadyConnected: return TEXT("The stream is already connected to another node.");
  29. case AK_InvalidFile: return TEXT("The provided file is the wrong format or unexpected values causes the file to be invalid.");
  30. case AK_AudioFileHeaderTooLarge: return TEXT("The file header is too large.");
  31. case AK_MaxReached: return TEXT("The maximum was reached.");
  32. case AK_InvalidID: return TEXT("The ID is invalid.");
  33. case AK_IDNotFound: return TEXT("The ID was not found.");
  34. case AK_InvalidInstanceID: return TEXT("The InstanceID is invalid.");
  35. case AK_NoMoreData: return TEXT("No more data is available from the source.");
  36. case AK_InvalidStateGroup: return TEXT("The StateGroup is not a valid channel.");
  37. case AK_ChildAlreadyHasAParent: return TEXT("The child already has a parent.");
  38. case AK_InvalidLanguage: return TEXT("The language is invalid (applies to the Low-Level I/O).");
  39. case AK_CannotAddItselfAsAChild: return TEXT("It is not possible to add itself as its own child.");
  40. case AK_InvalidParameter: return TEXT("Something is not within bounds, check the documentation of the function returning this code.");
  41. case AK_ElementAlreadyInList: return TEXT("The item could not be added because it was already in the list.");
  42. case AK_PathNotFound: return TEXT("This path is not known.");
  43. case AK_PathNoVertices: return TEXT("Stuff in vertices before trying to start it");
  44. case AK_PathNotRunning: return TEXT("Only a running path can be paused.");
  45. case AK_PathNotPaused: return TEXT("Only a paused path can be resumed.");
  46. case AK_PathNodeAlreadyInList: return TEXT("This path is already there.");
  47. case AK_PathNodeNotInList: return TEXT("This path is not there.");
  48. case AK_DataNeeded: return TEXT("The consumer needs more.");
  49. case AK_NoDataNeeded: return TEXT("The consumer does not need more.");
  50. case AK_DataReady: return TEXT("The provider has available data.");
  51. case AK_NoDataReady: return TEXT("The provider does not have available data.");
  52. case AK_InsufficientMemory: return TEXT("Memory error.");
  53. case AK_Cancelled: return TEXT("The requested action was cancelled (not an error).");
  54. case AK_UnknownBankID: return TEXT("Trying to load a bank using an ID which is not defined.");
  55. case AK_BankReadError: return TEXT("Error while reading a bank.");
  56. case AK_InvalidSwitchType: return TEXT("Invalid switch type (used with the switch container)");
  57. case AK_FormatNotReady: return TEXT("Source format not known yet.");
  58. case AK_WrongBankVersion: return TEXT("The bank version is not compatible with the current bank reader.");
  59. case AK_FileNotFound: return TEXT("File not found.");
  60. case AK_DeviceNotReady: return TEXT("Specified ID doesn't match a valid hardware device: either the device doesn't exist or is disabled.");
  61. case AK_BankAlreadyLoaded: return TEXT("The bank load failed because the bank is already loaded.");
  62. case AK_RenderedFX: return TEXT("The effect on the node is rendered.");
  63. case AK_ProcessNeeded: return TEXT("A routine needs to be executed on some CPU.");
  64. case AK_ProcessDone: return TEXT("The executed routine has finished its execution.");
  65. case AK_MemManagerNotInitialized: return TEXT("The memory manager should have been initialized at this point.");
  66. case AK_StreamMgrNotInitialized: return TEXT("The stream manager should have been initialized at this point.");
  67. case AK_SSEInstructionsNotSupported: return TEXT("The machine does not support SSE instructions (required on PC).");
  68. case AK_Busy: return TEXT("The system is busy and could not process the request.");
  69. case AK_UnsupportedChannelConfig: return TEXT("Channel configuration is not supported in the current execution context.");
  70. case AK_PluginMediaNotAvailable: return TEXT("Plugin media is not available for effect.");
  71. case AK_MustBeVirtualized: return TEXT("Sound was Not Allowed to play.");
  72. case AK_CommandTooLarge: return TEXT("SDK command is too large to fit in the command queue.");
  73. case AK_RejectedByFilter: return TEXT("A play request was rejected due to the MIDI filter parameters.");
  74. case AK_InvalidCustomPlatformName: return TEXT("Detecting incompatibility between Custom platform of banks and custom platform of connected application");
  75. case AK_DLLCannotLoad: return TEXT("Plugin DLL could not be loaded, either because it is not found or one dependency is missing.");
  76. case AK_DLLPathNotFound: return TEXT("Plugin DLL search path could not be found.");
  77. case AK_NoJavaVM: return TEXT("No Java VM provided in AkInitSettings.");
  78. case AK_OpenSLError: return TEXT("OpenSL returned an error. Check error log for more details.");
  79. case AK_PluginNotRegistered: return TEXT("Plugin is not registered. Make sure to implement a AK::PluginRegistration class for it and use AK_STATIC_LINK_PLUGIN in the game binary.");
  80. case AK_DataAlignmentError: return TEXT("A pointer to audio data was not aligned to the platform's required alignment (check AkTypes.h in the platform-specific folder)");
  81. case AK_DeviceNotCompatible: return TEXT("Incompatible Audio device.");
  82. case AK_DuplicateUniqueID: return TEXT("Two Wwise objects share the same ID.");
  83. case AK_InitBankNotLoaded: return TEXT("The Init bank was not loaded yet, the sound engine isn't completely ready yet.");
  84. case AK_DeviceNotFound: return TEXT("The specified device ID does not match with any of the output devices that the sound engine is currently using.");
  85. case AK_PlayingIDNotFound: return TEXT("Calling a function with a playing ID that is not known.");
  86. case AK_InvalidFloatValue: return TEXT("One parameter has a invalid float value such as NaN, INF or FLT_MAX.");
  87. case AK_FileFormatMismatch: return TEXT("Media file format unexpected");
  88. case AK_NoDistinctListener: return TEXT("No distinct listener provided for AddOutput");
  89. case AK_ACP_Error: return TEXT("Generic XMA decoder error.");
  90. case AK_ResourceInUse: return TEXT("Resource is in use and cannot be released.");
  91. case AK_InvalidBankType: return TEXT("Invalid bank type. The bank type was either supplied through a function call (e.g. LoadBank) or obtained from a bank loaded from memory.");
  92. case AK_AlreadyInitialized: return TEXT("Init() was called but that element was already initialized.");
  93. case AK_NotInitialized: return TEXT("The component being used is not initialized. Most likely AK::SoundEngine::Init() was not called yet, or AK::SoundEngine::Term was called too early.");
  94. case AK_FilePermissionError: return TEXT("The file access permissions prevent opening a file.");
  95. case AK_UnknownFileError: return TEXT("Rare file error occured, as opposed to AK_FileNotFound or AK_FilePermissionError. This lumps all unrecognized OS file system errors.");
  96. #if WWISE_2023_1_OR_LATER
  97. case AK_TooManyConcurrentOperations: return TEXT("When using StdStream, file operations can be blocking or not. When not blocking, operations need to be synchronized externally properly. If not, this error occurs.");
  98. case AK_InvalidFileSize: return TEXT("The file requested was found and opened but is either 0 bytes long or not the expected size. This usually point toward a Low Level IO Hook implementation error.");
  99. case AK_Deferred: return TEXT("Returned by functions to indicate to the caller the that the operation is done asynchronously. Used by Low Level IO Hook implementations when async operation are suppored by the hardware.");
  100. case AK_FilePathTooLong: return TEXT("The combination of base path and file name exceeds maximum buffer lengths.");
  101. #endif
  102. default: return TEXT("Unknown Error.");
  103. }
  104. }
  105. }