AkSoundEngine.h 302 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468
  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. // AkSoundEngine.h
  21. /// \file
  22. /// The main sound engine interface.
  23. #ifndef _AK_SOUNDENGINE_H_
  24. #define _AK_SOUNDENGINE_H_
  25. #include <AK/SoundEngine/Common/AkSoundEngineExport.h>
  26. #include <AK/SoundEngine/Common/AkTypes.h>
  27. #include <AK/SoundEngine/Common/IAkPlugin.h>
  28. #include <AK/SoundEngine/Common/AkCallback.h>
  29. #ifdef AK_WIN
  30. #include <AK/SoundEngine/Platforms/Windows/AkWinSoundEngine.h>
  31. #include <AK/SoundEngine/Platforms/Windows/AkPlatformContext.h>
  32. #elif defined (AK_MAC_OS_X)
  33. #include <AK/SoundEngine/Platforms/Mac/AkMacSoundEngine.h>
  34. #include <AK/SoundEngine/Platforms/Mac/AkPlatformContext.h>
  35. #elif defined (AK_IOS)
  36. #include <AK/SoundEngine/Platforms/iOS/AkiOSSoundEngine.h>
  37. #include <AK/SoundEngine/Platforms/iOS/AkPlatformContext.h>
  38. #elif defined(AK_XBOXGC) // Gaming.Xbox platform
  39. #include <AK/SoundEngine/Platforms/XboxGC/AkXboxGCSoundEngine.h>
  40. #include <AK/SoundEngine/Platforms/XboxGC/AkPlatformContext.h>
  41. #elif defined (AK_XBOXONE)
  42. #include <AK/SoundEngine/Platforms/XboxOne/AkXboxOneSoundEngine.h>
  43. #include <AK/SoundEngine/Platforms/XboxOne/AkPlatformContext.h>
  44. #elif defined( AK_LUMIN )
  45. #include <AK/SoundEngine/Platforms/Lumin/AkLuminSoundEngine.h>
  46. #include <AK/SoundEngine/Platforms/Lumin/AkPlatformContext.h>
  47. #elif defined( AK_ANDROID )
  48. #include <AK/SoundEngine/Platforms/Android/AkAndroidSoundEngine.h>
  49. #include <AK/SoundEngine/Platforms/Android/AkPlatformContext.h>
  50. #elif defined (AK_PS4)
  51. #include <AK/SoundEngine/Platforms/PS4/AkPS4SoundEngine.h>
  52. #include <AK/SoundEngine/Platforms/PS4/AkPlatformContext.h>
  53. #elif defined (AK_PS5)
  54. #include <AK/SoundEngine/Platforms/PS5/AkPS5SoundEngine.h>
  55. #include <AK/SoundEngine/Platforms/PS5/AkPlatformContext.h>
  56. #elif defined( AK_GGP )
  57. #include <AK/SoundEngine/Platforms/GGP/AkGGPSoundEngine.h>
  58. #include <AK/SoundEngine/Platforms/GGP/AkPlatformContext.h>
  59. #elif defined( AK_LINUX_DESKTOP )
  60. #include <AK/SoundEngine/Platforms/Linux/AkLinuxSoundEngine.h>
  61. #include <AK/SoundEngine/Platforms/Linux/AkPlatformContext.h>
  62. #elif defined( AK_EMSCRIPTEN )
  63. #include <AK/SoundEngine/Platforms/Emscripten/AkEmscriptenSoundEngine.h>
  64. #include <AK/SoundEngine/Platforms/Emscripten/AkPlatformContext.h>
  65. #elif defined( AK_QNX )
  66. #include <AK/SoundEngine/Platforms/QNX/AkQNXSoundEngine.h>
  67. #include <AK/SoundEngine/Platforms/QNX/AkPlatformContext.h>
  68. #elif defined( AK_NX )
  69. #include <AK/SoundEngine/Platforms/NX/AkNXSoundEngine.h>
  70. #include <AK/SoundEngine/Platforms/NX/AkPlatformContext.h>
  71. #else
  72. #error AkSoundEngine.h: Undefined platform
  73. #endif
  74. #ifndef AK_ASSERT_HOOK
  75. /// Function called on assert handling, optional
  76. /// \sa
  77. /// - AkInitSettings
  78. AK_CALLBACK( void, AkAssertHook)(
  79. const char * in_pszExpression, ///< Expression
  80. const char * in_pszFileName, ///< File Name
  81. int in_lineNumber ///< Line Number
  82. );
  83. #define AK_ASSERT_HOOK
  84. #endif
  85. /// Callback function prototype for User Music notifications
  86. /// It is useful for reacting to user music playback.
  87. ///
  88. /// \sa
  89. /// - \ref AkGlobalCallbackFunc
  90. /// - \ref AkPlatformInitSettings
  91. /// - \ref background_music_and_dvr
  92. ///
  93. typedef AKRESULT ( * AkBackgroundMusicChangeCallbackFunc )(
  94. bool in_bBackgroundMusicMuted, ///< Flag indicating whether the busses tagged as "background music" in the project are muted or not.
  95. void* in_pCookie ///< User-provided data, e.g. a user structure.
  96. );
  97. /// Platform-independent initialization settings of output devices.
  98. struct AkOutputSettings
  99. {
  100. AkOutputSettings() :
  101. audioDeviceShareset(AK_INVALID_UNIQUE_ID),
  102. idDevice(0),
  103. ePanningRule(AkPanningRule_Speakers),
  104. channelConfig(){};
  105. AkOutputSettings(const char* in_szDeviceShareSet, AkUniqueID in_idDevice = AK_INVALID_UNIQUE_ID, AkChannelConfig in_channelConfig = AkChannelConfig(), AkPanningRule in_ePanning = AkPanningRule_Speakers);
  106. #ifdef AK_SUPPORT_WCHAR
  107. AkOutputSettings(const wchar_t* in_szDeviceShareSet, AkUniqueID in_idDevice = AK_INVALID_UNIQUE_ID, AkChannelConfig in_channelConfig = AkChannelConfig(), AkPanningRule in_ePanning = AkPanningRule_Speakers);
  108. #endif
  109. AkUniqueID audioDeviceShareset; ///< Unique ID of a custom audio device to be used. Custom audio devices are defined in the Audio Device Shareset section of the Wwise project.
  110. ///< If you want to output normally through the output device defined on the Master Bus in your project, leave this field to its default value (AK_INVALID_UNIQUE_ID, or value 0).
  111. ///< Typical usage: AkInitSettings.eOutputSettings.audioDeviceShareset = AK::SoundEngine::GetIDFromString("InsertYourAudioDeviceSharesetNameHere");
  112. /// \sa <tt>\ref AK::SoundEngine::GetIDFromString()</tt>
  113. /// \sa \ref soundengine_plugins_audiodevices
  114. /// \sa \ref integrating_secondary_outputs
  115. /// \sa \ref default_audio_devices
  116. AkUInt32 idDevice; ///< Device specific identifier, when multiple devices of the same type are possible. If only one device is possible, leave to 0.
  117. /// \sa \ref obtaining_device_id
  118. AkPanningRule ePanningRule; ///< Rule for 3D panning of signals routed to a stereo bus. In AkPanningRule_Speakers mode, the angle of the front loudspeakers
  119. ///< (uSpeakerAngles[0]) is used. In AkPanningRule_Headphones mode, the speaker angles are superseded by constant power panning
  120. ///< between two virtual microphones spaced 180 degrees apart.
  121. AkChannelConfig channelConfig; ///< Channel configuration for this output. Call AkChannelConfig::Clear() to let the engine use the default output configuration.
  122. ///< Hardware might not support the selected configuration.
  123. };
  124. /// Define the orientation of the the floor plane with respect to the X,Y,Z axes, and which axes represent the side, front and up vectors as a basis for rotations in Wwise.
  125. /// AkFloorPlane is used in to orient the Game Object 3D Viewer in Wwise, and in the transformation of geometry instances in Wwise Spatial Audio.
  126. enum AkFloorPlane
  127. {
  128. AkFloorPlane_XZ = 0, ///< The floor is oriented along the ZX-plane. The front vector points towards +Z, the up vector towards +Y, and the side vector towards +X.
  129. AkFloorPlane_XY, ///< The floor is oriented along the XY-plane. The front vector points towards +X, the up vector towards +Z, and the side vector towards +Y.
  130. AkFloorPlane_YZ, ///< The floor is oriented along the YZ-plane. The front vector points towards +Y, the up vector towards +X, and the side vector towards +Z.
  131. AkFloorPlane_Default = AkFloorPlane_XZ ///< The Wwise default floor plane is ZX.
  132. };
  133. // Function that the host runtime must call to allow for jobs to execute.
  134. // in_jobType is the type originally provided by AkJobMgrSettings::FuncRequestJobWorker.
  135. // in_uExecutionTimeUsec is the number of microseconds that the function should execute for before terminating.
  136. // Note that the deadline is only checked after each individual job completes execution, so the function may run slightly
  137. // longer than intended. The "in_uExecutionTimeUsec" should be considered a suggestion or guideline, not a strict rule.
  138. // A value of 0 means that the function will run until there are no more jobs ready to be immediately executed.
  139. AK_CALLBACK(void, AkJobWorkerFunc)(
  140. AkJobType in_jobType,
  141. AkUInt32 in_uExecutionTimeUsec
  142. );
  143. /// Settings for the Sound Engine's internal job manager
  144. struct AkJobMgrSettings
  145. {
  146. /// Callback function prototype definition used for handling requests from JobMgr for new workers to perform work.
  147. AK_CALLBACK(void, FuncRequestJobWorker)(
  148. AkJobWorkerFunc in_fnJobWorker, ///< Function passed to host runtime that should be executed. Note that the function provided will exist for as long as the soundengine code is loaded, and will always be the same.
  149. AkJobType in_jobType, ///< The type of job worker that has been requested. This should be passed forward to in_fnJobWorker
  150. AkUInt32 in_uNumWorkers, ///< Number of workers requested
  151. void * in_pClientData ///< Data provided by client in AkJobMgrSettings
  152. );
  153. FuncRequestJobWorker fnRequestJobWorker; ///< Function called by the job manager when a new worker needs to be requested. When null, all jobs will be executed on the same thread that calls RenderAudio().
  154. AkUInt32 uMaxActiveWorkers[AK_NUM_JOB_TYPES]; ///< The maximum number of concurrent workers that will be requested. Must be >= 1 for each jobType.
  155. AkUInt32 uNumMemorySlabs; ///< Number of memory slabs to pre-allocate for job manager memory. At least one slab per worker thread should be pre-allocated. Default is 1.
  156. AkUInt32 uMemorySlabSize; ///< Size of each memory slab used for job manager memory. Must be a power of two. Default is 8K.
  157. void* pClientData; ///< Arbitrary data that will be passed back to the client when calling FuncRequestJobWorker
  158. };
  159. /// External (optional) callback for tracking performance of the sound engine that is called when a timer starts. (only called in Debug and Profile binaries; this is not called in Release)
  160. /// in_uPluginID may be non-zero when this function is called, to provide extra data about what context this Timer was started in.
  161. /// in_pszZoneName will point to a static string, so the pointer can be stored for later use, not just the contents of the string itself.
  162. AK_CALLBACK(void, AkProfilerPushTimerFunc)(
  163. AkPluginID in_uPluginID,
  164. const char* in_pszZoneName
  165. );
  166. /// External (optional) function for tracking performance of the sound engine that is called when a timer stops. (only called in Debug and Profile binaries; this is not called in Release)
  167. AK_CALLBACK(void, AkProfilerPopTimerFunc)();
  168. ///< External (optional) function for tracking notable events in the sound engine, to act as a marker or bookmark. (only called in Debug and Profile binaries; this is not called in Release)
  169. /// in_uPluginID may be non-zero when this function is called, to provide extra data about what context this Marker was posted in.
  170. /// in_pszMarkerName will point to a static string, so the pointer can be stored for later use, not just the contents of the string itself.
  171. AK_CALLBACK(void, AkProfilerPostMarkerFunc)(
  172. AkPluginID in_uPluginID,
  173. const char* in_pszMarkerName
  174. );
  175. /// Platform-independent initialization settings of the sound engine
  176. /// \sa
  177. /// - <tt>AK::SoundEngine::Init()</tt>
  178. /// - <tt>AK::SoundEngine::GetDefaultInitSettings()</tt>
  179. /// - \ref soundengine_integration_init_advanced
  180. struct AkInitSettings
  181. {
  182. AkAssertHook pfnAssertHook; ///< External assertion handling function (optional)
  183. AkUInt32 uMaxNumPaths; ///< Maximum number of paths for positioning
  184. AkUInt32 uCommandQueueSize; ///< Size of the command queue, in bytes
  185. bool bEnableGameSyncPreparation; ///< Sets to true to enable AK::SoundEngine::PrepareGameSync usage.
  186. AkUInt32 uContinuousPlaybackLookAhead; ///< Number of quanta ahead when continuous containers should instantiate a new voice before which next sounds should start playing. This look-ahead time allows I/O to occur, and is especially useful to reduce the latency of continuous containers with trigger rate or sample-accurate transitions.
  187. ///< Default is 1 audio quantum, also known as an audio frame. Its size is equal to AkInitSettings::uNumSamplesPerFrame / AkPlatformInitSettings::uSampleRate. For many platforms the default values - which can be overridden - are respectively 1,024 samples and 48 kHz. This gives a default 21.3 ms for an audio quantum, which is adequate if you have a RAM-based streaming device that completes transfers within 20 ms. With 1 look-ahead quantum, voices spawned by continuous containers are more likely to be ready when they are required to play, thereby improving the overall precision of sound scheduling. If your device completes transfers in 30 ms instead, you might consider increasing this value to 2 because it will grant new voices 2 audio quanta (~43 ms) to fetch data.
  188. AkUInt32 uNumSamplesPerFrame; ///< Number of samples per audio frame (256, 512, 1024, or 2048).
  189. AkUInt32 uMonitorQueuePoolSize; ///< Size of the monitoring queue, in bytes. This parameter is not used in Release build.
  190. AkUInt32 uCpuMonitorQueueMaxSize; ///< Maximum size of the CPU monitoring queue, per thread, in bytes. This parameter is not used in Release build.
  191. AkOutputSettings settingsMainOutput; ///< Main output device settings.
  192. AkJobMgrSettings settingsJobManager; ///< Settings to configure the behavior of the Sound Engine's internal job manager
  193. AkUInt32 uMaxHardwareTimeoutMs; ///< Amount of time to wait for HW devices to trigger an audio interrupt. If there is no interrupt after that time, the sound engine will revert to silent mode and continue operating until the HW finally comes back. Default value: 2000 (2 seconds)
  194. bool bUseSoundBankMgrThread; ///< Use a separate thread for loading sound banks. Allows asynchronous operations.
  195. bool bUseLEngineThread; ///< Use a separate thread for processing audio. If set to false, audio processing will occur in RenderAudio(). \ref goingfurther_eventmgrthread
  196. AkBackgroundMusicChangeCallbackFunc BGMCallback; ///< Application-defined audio source change event callback function.
  197. void* BGMCallbackCookie; ///< Application-defined user data for the audio source change event callback function.
  198. AkOSChar * szPluginDLLPath; ///< When using DLLs for plugins, specify their path. Leave NULL if DLLs are in the same folder as the game executable.
  199. AkFloorPlane eFloorPlane; ///< Define the orientation of the the floor plane with respect to the X,Y,Z axes, and which axes represent the side, front and up vectors as a basis for rotations in Wwise.
  200. ///< AkFloorPlane is used in to orient the Game Object 3D Viewer in Wwise, and in the transformation of geometry instances in Wwise Spatial Audio.
  201. AkReal32 fGameUnitsToMeters; ///< The number of game units in a meter.
  202. ///< This setting is used to adapt the size of elements in the Authoring's Game Object 3D Viewer and Audio Object 3D Viewer to meters.
  203. ///< This setting is also used to simulate real-world positioning of System Audio Objects, to improve the HRTF in some cases.
  204. AkUInt32 uBankReadBufferSize; ///< The number of bytes read by the BankReader when new data needs to be loaded from disk during serialization. Increasing this trades memory usage for larger, but fewer, file-read events during bank loading.
  205. AkReal32 fDebugOutOfRangeLimit; ///< Debug setting: Only used when bDebugOutOfRangeCheckEnabled is true. This defines the maximum values samples can have. Normal audio must be contained within +1/-1. This limit should be set higher to allow temporary or short excursions out of range. Default is 16.
  206. bool bDebugOutOfRangeCheckEnabled; ///< Debug setting: Enable checks for out-of-range (and NAN) floats in the processing code. This incurs a small performance hit, but can be enabled in most scenarios. Will print error messages in the log if invalid values are found at various point in the pipeline. Contact AK Support with the new error messages for more information.
  207. AkProfilerPushTimerFunc fnProfilerPushTimer; ///< External (optional) function for tracking performance of the sound engine that is called when a timer starts. (only called in Debug and Profile binaries; this is not called in Release)
  208. AkProfilerPopTimerFunc fnProfilerPopTimer; ///< External (optional) function for tracking performance of the sound engine that is called when a timer stops. (only called in Debug and Profile binaries; this is not called in Release)
  209. AkProfilerPostMarkerFunc fnProfilerPostMarker; ///< External (optional) function for tracking significant events in the sound engine, to act as a marker or bookmark. (only called in Debug and Profile binaries; this is not called in Release)
  210. };
  211. /// Necessary settings for setting externally-loaded sources
  212. struct AkSourceSettings
  213. {
  214. AkUniqueID sourceID; ///< Source ID (available in the SoundBank content files)
  215. AkUInt8* pMediaMemory; ///< Pointer to the data to be set for the source
  216. AkUInt32 uMediaSize; ///< Size, in bytes, of the data to be set for the source
  217. };
  218. /// Return values for GetSourcePlayPositions.
  219. struct AkSourcePosition
  220. {
  221. AkUniqueID audioNodeID; ///< Audio Node ID of playing item
  222. AkUniqueID mediaID; ///< Media ID of playing item. (corresponds to 'ID' attribute of 'File' element in SoundBank metadata file)
  223. AkTimeMs msTime; ///< Position of the source (in ms) associated with that playing item
  224. AkUInt32 samplePosition; ///< Position of the source (in samples) associated with that playing item
  225. AkUInt32 updateBufferTick; ///< Value of GetBufferTick() at the time the position was updated
  226. };
  227. /// Audiokinetic namespace
  228. namespace AK
  229. {
  230. class IReadBytes;
  231. class IWriteBytes;
  232. /// Audiokinetic sound engine namespace
  233. /// \remarks The functions in this namespace are thread-safe, unless stated otherwise.
  234. namespace SoundEngine
  235. {
  236. ///////////////////////////////////////////////////////////////////////
  237. /// @name Initialization
  238. //@{
  239. /// Query whether or not the sound engine has been successfully initialized.
  240. /// \warning This function is not thread-safe. It should not be called at the same time as \c SoundEngine::Init() or \c SoundEngine::Term().
  241. /// \return \c True if the sound engine has been initialized, \c False otherwise.
  242. /// \sa
  243. /// - \ref soundengine_integration_init_advanced
  244. /// - <tt>AK::SoundEngine::Init()</tt>
  245. /// - <tt>AK::SoundEngine::Term()</tt>
  246. AK_EXTERNAPIFUNC( bool, IsInitialized )();
  247. /// Initialize the sound engine.
  248. /// \warning This function is not thread-safe.
  249. /// \remark The initial settings should be initialized using <tt>AK::SoundEngine::GetDefaultInitSettings()</tt>
  250. /// and <tt>AK::SoundEngine::GetDefaultPlatformInitSettings()</tt> to fill the structures with their
  251. /// default settings. This is not mandatory, but it helps avoid backward compatibility problems.
  252. ///
  253. /// \return
  254. /// - \c AK_Success if the initialization was successful
  255. /// - \c AK_MemManagerNotInitialized if the memory manager is not available or not properly initialized
  256. /// - \c AK_StreamMgrNotInitialized if the stream manager is not available or not properly initialized
  257. /// - \c AK_SSEInstructionsNotSupported if the machine does not support SSE instruction (only on the PC)
  258. /// - \c AK_InsufficientMemory if there is not enough memory available to initialize the sound engine properly
  259. /// - \c AK_InvalidParameter if some parameters are invalid
  260. /// - \c AK_AlreadyInitialized if the sound engine is already initialized, or if the provided settings result in insufficient
  261. /// - \c AK_Fail for unknown errors, check with AK Support.
  262. /// resources for the initialization.
  263. /// \sa
  264. /// - \ref soundengine_integration_init_advanced
  265. /// - \ref workingwithsdks_initialization
  266. /// - <tt>AK::SoundEngine::Term()</tt>
  267. /// - <tt>AK::SoundEngine::GetDefaultInitSettings()</tt>
  268. /// - <tt>AK::SoundEngine::GetDefaultPlatformInitSettings()</tt>
  269. AK_EXTERNAPIFUNC( AKRESULT, Init )(
  270. AkInitSettings * in_pSettings, ///< Initialization settings (can be NULL, to use the default values)
  271. AkPlatformInitSettings * in_pPlatformSettings ///< Platform-specific settings (can be NULL, to use the default values)
  272. );
  273. /// Gets the default values of the platform-independent initialization settings.
  274. /// \warning This function is not thread-safe.
  275. /// \sa
  276. /// - \ref soundengine_integration_init_advanced
  277. /// - <tt>AK::SoundEngine::Init()</tt>
  278. /// - <tt>AK::SoundEngine::GetDefaultPlatformInitSettings()</tt>
  279. AK_EXTERNAPIFUNC( void, GetDefaultInitSettings )(
  280. AkInitSettings & out_settings ///< Returned default platform-independent sound engine settings
  281. );
  282. /// Gets the default values of the platform-specific initialization settings.
  283. ///
  284. /// Windows Specific:
  285. /// HWND is the handle of the window associated with the audio.
  286. /// Each game must specify the HWND of the application for device detection purposes.
  287. /// The value returned by GetDefaultPlatformInitSettings is the foreground HWND at
  288. /// the moment of the initialization of the sound engine and might not be the correct one for your game.
  289. /// Each game must provide the correct HWND to use.
  290. ///
  291. /// \warning This function is not thread-safe.
  292. /// \sa
  293. /// - \ref soundengine_integration_init_advanced
  294. /// - <tt>AK::SoundEngine::Init()</tt>
  295. /// - <tt>AK::SoundEngine::GetDefaultInitSettings()</tt>
  296. AK_EXTERNAPIFUNC( void, GetDefaultPlatformInitSettings )(
  297. AkPlatformInitSettings & out_platformSettings ///< Returned default platform-specific sound engine settings
  298. );
  299. /// Terminates the sound engine.
  300. /// If some sounds are still playing or events are still being processed when this function is
  301. /// called, they will be stopped.
  302. /// \warning This function is not thread-safe.
  303. /// \warning Before calling Term, you must ensure that no other thread is accessing the sound engine.
  304. /// \sa
  305. /// - \ref soundengine_integration_init_advanced
  306. /// - <tt>AK::SoundEngine::Init()</tt>
  307. AK_EXTERNAPIFUNC( void, Term )();
  308. /// Gets the configured audio settings.
  309. /// Call this function to get the configured audio settings.
  310. ///
  311. /// \warning This function is not thread-safe.
  312. /// \warning Call this function only after the sound engine has been properly initialized.
  313. /// \return
  314. /// - \c AK_NotInitialized if <tt>AK::SoundEngine::Init()</tt> was not called
  315. /// - \c AK_Success otherwise.
  316. AK_EXTERNAPIFUNC( AKRESULT, GetAudioSettings )(
  317. AkAudioSettings & out_audioSettings ///< Returned audio settings
  318. );
  319. /// Gets the output speaker configuration of the specified output.
  320. /// Call this function to get the speaker configuration of the output (which may not correspond
  321. /// to the physical output format of the platform, in the case of downmixing provided by the platform itself).
  322. /// You may initialize the sound engine with a user-specified configuration, but the resulting
  323. /// configuration is determined by the sound engine, based on the platform, output type and
  324. /// platform settings (for e.g. system menu or control panel option).
  325. /// If the speaker configuration of the output is object-based, the speaker configuration of the
  326. /// main mix is returned. To query more information on object-based output devices, see AK::SoundEngine::GetOutputDeviceConfiguration.
  327. ///
  328. /// It is recommended to call GetSpeakerConfiguration anytime after receiving a callback from RegisterAudioDeviceStatusCallback to know if the channel configuration has changed.
  329. ///
  330. /// \warning Call this function only after the sound engine has been properly initialized.
  331. /// If you are initializing the sound engine with AkInitSettings::bUseLEngineThread to false, it is required to call RenderAudio() at least once before calling this function to complete the sound engine initialization.
  332. /// The Init.bnk must be loaded prior to this call.
  333. /// \return The output configuration. An empty AkChannelConfig not AkChannelConfig::IsValid() if device does not exist or if the Init.bnk was not loaded yet.
  334. /// \sa
  335. /// - AkSpeakerConfig.h
  336. /// - AkOutputSettings
  337. /// - <tt>AK::SoundEngine::GetOutputDeviceConfiguration()</tt>
  338. AK_EXTERNAPIFUNC( AkChannelConfig, GetSpeakerConfiguration )(
  339. AkOutputDeviceID in_idOutput = 0 ///< Output ID to set the bus on. As returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  340. );
  341. /// Gets the configuration of the specified output device.
  342. /// Call this function to get the channel configuration of the output device as well as its 3D audio capabilities.
  343. /// If the configuration of the output device is object-based (io_channelConfig.eConfigType == AK_ChannelConfigType_Objects),
  344. /// io_capabilities can be inspected to determine the channel configuration of the main mix (Ak3DAudioSinkCapabilities::channelConfig),
  345. /// whether or not the output device uses a passthrough mix (Ak3DAudioSinkCapabilities::bPassthrough) and the maximum number of objects
  346. /// that can play simultaneously on this output device (Ak3DAudioSinkCapabilities::uMax3DAudioObjects). Note that if
  347. /// Ak3DAudioSinkCapabilities::bMultiChannelObjects is false, multi-channel objects will be split into multiple mono objects
  348. /// before being sent to the output device.
  349. ///
  350. /// \warning Call this function only after the sound engine has been properly initialized. If you are initializing the sound engine with AkInitSettings::bUseLEngineThread to false, it is required to call RenderAudio() at least once before calling this function to complete the sound engine initialization.
  351. /// \return
  352. /// - \c AK_Success if successful
  353. /// - \c AK_IDNotFound is the output was not found in the system.
  354. /// - \c AK_NotInitialized if the sound engine is not initialized
  355. /// \sa
  356. /// - AkSpeakerConfig.h
  357. /// - AkOutputSettings
  358. /// - <tt>AK::SoundEngine::GetSpeakerConfiguration()</tt>
  359. AK_EXTERNAPIFUNC(AKRESULT, GetOutputDeviceConfiguration)(
  360. AkOutputDeviceID in_idOutput,
  361. AkChannelConfig& io_channelConfig,
  362. Ak3DAudioSinkCapabilities& io_capabilities
  363. );
  364. /// Gets the panning rule of the specified output.
  365. /// \warning Call this function only after the sound engine has been properly initialized.
  366. /// Returns the supported configuration in out_ePanningRule:
  367. /// - AkPanningRule_Speakers
  368. /// - AkPanningRule_Headphone
  369. /// \return
  370. /// - \c AK_Success if successful
  371. /// - \c AK_IDNotFound is the output was not found in the system.
  372. /// - \c AK_NotInitialized if the sound engine is not initialized
  373. /// \sa
  374. /// - AkSpeakerConfig.h
  375. AK_EXTERNAPIFUNC( AKRESULT, GetPanningRule )(
  376. AkPanningRule & out_ePanningRule, ///< Returned panning rule (AkPanningRule_Speakers or AkPanningRule_Headphone) for given output.
  377. AkOutputDeviceID in_idOutput = 0 ///< Output ID to set the bus on. As returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  378. );
  379. /// Sets the panning rule of the specified output.
  380. /// This may be changed anytime once the sound engine is initialized.
  381. /// \warning This function posts a message through the sound engine's internal message queue, whereas GetPanningRule() queries the current panning rule directly.
  382. /// \aknote
  383. /// The specified panning rule will only impact the sound if the processing format is downmixing to Stereo in the mixing process. It
  384. /// will not impact the output if the audio stays in 5.1 until the end, for example.
  385. /// \endaknote
  386. AK_EXTERNAPIFUNC( AKRESULT, SetPanningRule )(
  387. AkPanningRule in_ePanningRule, ///< Panning rule.
  388. AkOutputDeviceID in_idOutput = 0 ///< Output ID to set the bus on. As returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  389. );
  390. /// Gets speaker angles of the specified device. Speaker angles are used for 3D positioning of sounds over standard configurations.
  391. /// Note that the current version of Wwise only supports positioning on the plane.
  392. /// The speaker angles are expressed as an array of loudspeaker pairs, in degrees, relative to azimuth ]0,180].
  393. /// Supported loudspeaker setups are always symmetric; the center speaker is always in the middle and thus not specified by angles.
  394. /// Angles must be set in ascending order.
  395. /// You may call this function with io_pfSpeakerAngles set to NULL to get the expected number of angle values in io_uNumAngles,
  396. /// in order to allocate your array correctly. You may also obtain this number by calling
  397. /// AK::GetNumberOfAnglesForConfig( AK_SPEAKER_SETUP_DEFAULT_PLANE ).
  398. /// If io_pfSpeakerAngles is not NULL, the array is filled with up to io_uNumAngles.
  399. /// Typical usage:
  400. /// - AkUInt32 uNumAngles;
  401. /// - GetSpeakerAngles( NULL, uNumAngles, AkOutput_Main );
  402. /// - AkReal32 * pfSpeakerAngles = AkAlloca( uNumAngles * sizeof(AkReal32) );
  403. /// - GetSpeakerAngles( pfSpeakerAngles, uNumAngles, AkOutput_Main );
  404. /// \aknote
  405. /// On most platforms, the angle set on the plane consists of 3 angles, to account for 7.1.
  406. /// - When panning to stereo (speaker mode, see <tt>AK::SoundEngine::SetPanningRule()</tt>), only angle[0] is used, and 3D sounds in the back of the listener are mirrored to the front.
  407. /// - When panning to 5.1, the front speakers use angle[0], and the surround speakers use (angle[2] - angle[1]) / 2.
  408. /// \endaknote
  409. /// \warning Call this function only after the sound engine has been properly initialized.
  410. /// \return AK_Success if device exists.
  411. /// \sa SetSpeakerAngles()
  412. AK_EXTERNAPIFUNC( AKRESULT, GetSpeakerAngles )(
  413. AkReal32 * io_pfSpeakerAngles, ///< Returned array of loudspeaker pair angles, in degrees relative to azimuth [0,180]. Pass NULL to get the required size of the array.
  414. AkUInt32 & io_uNumAngles, ///< Returned number of angles in io_pfSpeakerAngles, which is the minimum between the value that you pass in, and the number of angles corresponding to AK::GetNumberOfAnglesForConfig( AK_SPEAKER_SETUP_DEFAULT_PLANE ), or just the latter if io_pfSpeakerAngles is NULL.
  415. AkReal32 & out_fHeightAngle, ///< Elevation of the height layer, in degrees relative to the plane [-90,90].
  416. AkOutputDeviceID in_idOutput = 0 ///< Output ID to set the bus on. As returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  417. );
  418. /// Sets speaker angles of the specified device. Speaker angles are used for 3D positioning of sounds over standard configurations.
  419. /// Note that the current version of Wwise only supports positioning on the plane.
  420. /// The speaker angles are expressed as an array of loudspeaker pairs, in degrees, relative to azimuth ]0,180].
  421. /// Supported loudspeaker setups are always symmetric; the center speaker is always in the middle and thus not specified by angles.
  422. /// Angles must be set in ascending order.
  423. /// Note:
  424. /// - This function requires that the minimum speaker angle is at least 5 degrees; as well as the subsequent speaker pairs are at least 5 degrees apart.
  425. /// Typical usage:
  426. /// - Initialize the sound engine and/or add secondary output(s).
  427. /// - Get number of speaker angles and their value into an array using GetSpeakerAngles().
  428. /// - Modify the angles and call SetSpeakerAngles().
  429. /// This function posts a message to the audio thread through the command queue, so it is thread safe. However the result may not be immediately read with GetSpeakerAngles().
  430. /// \warning This function only applies to configurations (or subset of these configurations) that are standard and whose speakers are on the plane (2D).
  431. /// \return
  432. /// - \c AK_Success if successful.
  433. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  434. /// - \c AK_InsufficientMemory if there wasn't enough memory in the message queue
  435. /// - \c AK_InvalidParameter one of the parameter is invalid, check the debug log.
  436. /// \sa GetSpeakerAngles()
  437. AK_EXTERNAPIFUNC( AKRESULT, SetSpeakerAngles )(
  438. const AkReal32 * in_pfSpeakerAngles, ///< Array of loudspeaker pair angles, in degrees relative to azimuth [0,180].
  439. AkUInt32 in_uNumAngles, ///< Number of elements in in_pfSpeakerAngles. It must correspond to AK::GetNumberOfAnglesForConfig( AK_SPEAKER_SETUP_DEFAULT_PLANE ) (the value returned by GetSpeakerAngles()).
  440. AkReal32 in_fHeightAngle, ///< Elevation of the height layer, in degrees relative to the plane [-90,90].
  441. AkOutputDeviceID in_idOutput = 0 ///< Output ID to set the bus on. As returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  442. );
  443. /// Allows the game to set the volume threshold to be used by the sound engine to determine if a voice must go virtual.
  444. /// This may be changed anytime once the sound engine was initialized.
  445. /// If this function is not called, the used value will be the value specified in the platform specific project settings.
  446. /// \return
  447. /// - \c AK_Success if successful
  448. /// - \c AK_InvalidParameter if the threshold was not between 0 and -96.3 dB.
  449. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  450. AK_EXTERNAPIFUNC( AKRESULT, SetVolumeThreshold )(
  451. AkReal32 in_fVolumeThresholdDB ///< Volume Threshold, must be a value between 0 and -96.3 dB
  452. );
  453. /// Allows the game to set the maximum number of non virtual voices to be played simultaneously.
  454. /// This may be changed anytime once the sound engine was initialized.
  455. /// If this function is not called, the used value will be the value specified in the platform specific project settings.
  456. /// \return
  457. /// - \c AK_InvalidParameter if the threshold was not between 1 and MaxUInt16.
  458. /// - \c AK_Success if successful
  459. AK_EXTERNAPIFUNC( AKRESULT, SetMaxNumVoicesLimit )(
  460. AkUInt16 in_maxNumberVoices ///< Maximum number of non-virtual voices.
  461. );
  462. /// Allows the game to set new values for the maximum active workers for the job manager
  463. /// This may be changed anytime once the sound engine was initialized.
  464. /// This function may only be used if a worker function has been set via \ref AkJobMgrSettings.
  465. /// \return
  466. /// - \c AK_InvalidParameter in_jobType is not a valid jobtype, or in_uNewMaxActiveWorkers is not greater than 0
  467. /// - \c AK_NotInitialized JobMgr system was not already initialized with a function to request for workers
  468. /// - \c AK_Success if successful
  469. AK_EXTERNAPIFUNC( AKRESULT, SetJobMgrMaxActiveWorkers )(
  470. AkJobType in_jobType, ///< JobType to set new uMaxActiveWorkers for
  471. AkUInt32 in_uNewMaxActiveWorkers ///< New maximum number of active workers will request
  472. );
  473. //@}
  474. ////////////////////////////////////////////////////////////////////////
  475. /// @name Rendering Audio
  476. //@{
  477. /// Processes all commands in the sound engine's command queue.
  478. /// This method has to be called periodically (usually once per game frame).
  479. /// \sa
  480. /// - \ref concept_events
  481. /// - \ref soundengine_events
  482. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  483. /// \return Always returns AK_Success
  484. AK_EXTERNAPIFUNC( AKRESULT, RenderAudio )(
  485. bool in_bAllowSyncRender = true ///< When AkInitSettings::bUseLEngineThread is false, RenderAudio may generate an audio buffer -- unless in_bAllowSyncRender is set to false. Use in_bAllowSyncRender=false when calling RenderAudio from a Sound Engine callback.
  486. );
  487. //@}
  488. ////////////////////////////////////////////////////////////////////////
  489. /// @name Component Registration
  490. //@{
  491. /// Query interface to global plug-in context used for plug-in registration/initialization.
  492. /// \return Global plug-in context.
  493. AK_EXTERNAPIFUNC(AK::IAkGlobalPluginContext *, GetGlobalPluginContext)();
  494. /// Registers a plug-in with the sound engine and sets the callback functions to create the
  495. /// plug-in and its parameter node.
  496. /// \aknote
  497. /// This function is deprecated. Registration is now automatic if you link plug-ins statically. If plug-ins are dynamic libraries (such as DLLs or SOs), use \c RegisterPluginDLL.
  498. /// \endaknote
  499. /// \sa
  500. /// - \ref register_effects
  501. /// - \ref plugin_xml
  502. /// \return
  503. /// - \c AK_Success if successful
  504. /// - \c AK_InvalidParameter if invalid parameters were provided
  505. /// - \c AK_InsufficientMemory if there isn't enough memory to register the plug-in
  506. /// \remarks
  507. /// Codecs and plug-ins must be registered before loading banks that use them.\n
  508. /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  509. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  510. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  511. /// posting the event will fail.
  512. AK_EXTERNAPIFUNC( AKRESULT, RegisterPlugin )(
  513. AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
  514. AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
  515. AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
  516. AkCreatePluginCallback in_pCreateFunc, ///< Pointer to the plug-in's creation function
  517. AkCreateParamCallback in_pCreateParamFunc, ///< Pointer to the plug-in's parameter node creation function
  518. AkGetDeviceListCallback in_pGetDeviceList = NULL ///< Optional pointer to the plug-in's device enumeration function. Specify for a sink plug-in to support \ref AK::SoundEngine::GetDeviceList.
  519. );
  520. /// Loads a plug-in dynamic library and registers it with the sound engine.
  521. /// With dynamic linking, all plugins are automatically registered.
  522. /// The plug-in DLL must be in the OS-specific library path or in the same location as the executable. If not, set AkInitSettings.szPluginDLLPath.
  523. /// \return
  524. /// - \c AK_Success if successful.
  525. /// - \c AK_FileNotFound if the DLL is not found in the OS path or if it has extraneous dependencies not found.
  526. /// - \c AK_InsufficientMemory if the system ran out of resources while loading the dynamic library
  527. /// - \c AK_NotCompatible if the file was found but is not binary-compatible with the system's expected executable format
  528. /// - \c AK_InvalidFile if the symbol g_pAKPluginList is not exported by the dynamic library
  529. /// - \c AK_Fail if an unexpected system error was encountered
  530. AK_EXTERNAPIFUNC( AKRESULT, RegisterPluginDLL ) (
  531. const AkOSChar* in_DllName, ///< Name of the DLL to load, without "lib" prefix or extension.
  532. const AkOSChar* in_DllPath = NULL ///< Optional path to the DLL. Will override szPLuginDLLPath that was set in AkInitSettings.
  533. );
  534. /// Registers a codec type with the sound engine and set the callback functions to create the
  535. /// codec's file source and bank source nodes.
  536. /// \aknote
  537. /// This function is deprecated. Registration is now automatic if you link plugins statically. If plugins are dynamic libraries (such as DLLs or SOs), use RegisterPluginDLL.
  538. /// \endaknote
  539. /// \sa
  540. /// - \ref register_effects
  541. /// \return
  542. /// - \c AK_Success if successful
  543. /// - \c AK_InvalidParameter if invalid parameters were provided
  544. /// - \c AK_InsufficientMemory if there isn't enough memory to register the plug-in
  545. /// \remarks
  546. /// Codecs and plug-ins must be registered before loading banks that use them.\n
  547. /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  548. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  549. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  550. /// posting the Event will fail.
  551. AK_EXTERNAPIFUNC( AKRESULT, RegisterCodec )(
  552. AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
  553. AkUInt32 in_ulCodecID, ///< Codec identifier (as declared in the plug-in description XML file)
  554. AkCreateFileSourceCallback in_pFileCreateFunc, ///< Pointer to the codec's file source node creation function
  555. AkCreateBankSourceCallback in_pBankCreateFunc ///< Pointer to the codec's bank source node creation function
  556. );
  557. /// Registers a global callback function. This function will be called from the audio rendering thread, at the
  558. /// location specified by in_eLocation. This function will also be called from the thread calling
  559. /// AK::SoundEngine::Term with in_eLocation set to AkGlobalCallbackLocation_Term.
  560. /// For example, in order to be called at every audio rendering pass, and once during teardown for releasing resources, you would call
  561. /// RegisterGlobalCallback(myCallback, AkGlobalCallbackLocation_BeginRender | AkGlobalCallbackLocation_Term, myCookie, AkPluginTypeNone, 0, 0);
  562. /// \remarks
  563. /// A Plugin Type, Company ID and Plugin ID can be provided to this function to enable timing in the performance monitor.
  564. /// If the callback is being timed, it will contribute to the Total Plug-in CPU measurement, and also appear in the Plug-ins tab of the Advanced Profiler by plug-in type and ID.
  565. /// It is illegal to call this function while already inside of a global callback.
  566. /// This function might stall for several milliseconds before returning.
  567. /// \return
  568. /// - \c AK_Success if successful
  569. /// - \c AK_InvalidParameter if parameters are out of range (check debug console or Wwise Profiler)
  570. /// \sa
  571. /// - <tt>AK::SoundEngine::UnregisterGlobalCallback()</tt>
  572. /// - AkGlobalCallbackFunc
  573. /// - AkGlobalCallbackLocation
  574. AK_EXTERNAPIFUNC(AKRESULT, RegisterGlobalCallback)(
  575. AkGlobalCallbackFunc in_pCallback, ///< Function to register as a global callback.
  576. AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender, ///< Callback location defined in AkGlobalCallbackLocation. Bitwise OR multiple locations if needed.
  577. void * in_pCookie = NULL, ///< User cookie.
  578. AkPluginType in_eType = AkPluginTypeNone, ///< Plug-in type (for example, source or effect). AkPluginTypeNone for no timing.
  579. AkUInt32 in_ulCompanyID = 0, ///< Company identifier (as declared in the plug-in description XML file). 0 for no timing.
  580. AkUInt32 in_ulPluginID = 0 ///< Plug-in identifier (as declared in the plug-in description XML file). 0 for no timing.
  581. );
  582. /// Unregisters a global callback function, previously registered using RegisterGlobalCallback.
  583. /// \remarks
  584. /// It is legal to call this function while already inside of a global callback, If it is unregistering itself and not
  585. /// another callback.
  586. /// This function might stall for several milliseconds before returning.
  587. /// \return
  588. /// - \c AK_Success if successful
  589. /// - \c AK_InvalidParameter if parameters are out of range (check debug console or Wwise Profiler)
  590. /// \sa
  591. /// - <tt>AK::SoundEngine::RegisterGlobalCallback()</tt>
  592. /// - AkGlobalCallbackFunc
  593. /// - AkGlobalCallbackLocation
  594. AK_EXTERNAPIFUNC(AKRESULT, UnregisterGlobalCallback)(
  595. AkGlobalCallbackFunc in_pCallback, ///< Function to unregister as a global callback.
  596. AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender ///< Must match in_eLocation as passed to RegisterGlobalCallback for this callback.
  597. );
  598. /// Registers a resource monitor callback function that gets all of the resource usage data contained in the
  599. /// AkResourceMonitorDataSummary structure. This includes general information about the system, such as CPU usage,
  600. /// active Voices, and Events. This function will be called from the audio rendering thread at the end of each frame.
  601. /// \remarks
  602. /// If the callback is being timed, it will contribute to the Total Plug-in CPU measurement, and also appear in the Plug-ins tab of the Advanced Profiler by plug-in type and ID.
  603. /// It is illegal to call this function while already inside of a resource callback.
  604. /// This function might stall for several milliseconds before returning.
  605. /// This function will return AK_Fail in Release
  606. /// \sa
  607. /// - <tt>AK::SoundEngine::UnregisterResourceMonitorCallback()</tt>
  608. /// - AkResourceMonitorCallbackFunc
  609. AK_EXTERNAPIFUNC(AKRESULT, RegisterResourceMonitorCallback)(
  610. AkResourceMonitorCallbackFunc in_pCallback ///< Function to register as a resource monitor callback.
  611. );
  612. /// Unregisters a resource monitor callback function, previously registered using RegisterResourceMonitorCallback.
  613. /// \remarks
  614. /// It is legal to call this function while already inside of a resource monitor callback, If it is unregistering itself and not
  615. /// another callback.
  616. /// This function might stall for several milliseconds before returning.
  617. /// \sa
  618. /// - <tt>AK::SoundEngine::RegisterResourceMonitorCallback()</tt>
  619. /// - AkResourceMonitorCallbackFunc
  620. AK_EXTERNAPIFUNC(AKRESULT, UnregisterResourceMonitorCallback)(
  621. AkResourceMonitorCallbackFunc in_pCallback ///< Function to unregister as a resource monitor callback.
  622. );
  623. /// Registers a callback for the Audio Device status changes.
  624. /// The callback will be called from the audio thread
  625. /// Can be called prior to AK::SoundEngine::Init
  626. /// \sa AK::SoundEngine::AddOutput
  627. AK_EXTERNAPIFUNC(AKRESULT, RegisterAudioDeviceStatusCallback)(
  628. AK::AkDeviceStatusCallbackFunc in_pCallback ///< Function to register as a status callback.
  629. );
  630. /// Unregisters the callback for the Audio Device status changes, registered by RegisterAudioDeviceStatusCallback
  631. AK_EXTERNAPIFUNC(AKRESULT, UnregisterAudioDeviceStatusCallback)();
  632. //@}
  633. #ifdef AK_SUPPORT_WCHAR
  634. ////////////////////////////////////////////////////////////////////////
  635. /// @name Getting ID from strings
  636. //@{
  637. /// Universal converter from Unicode string to ID for the sound engine.
  638. /// This function will hash the name based on a algorithm ( provided at : /AK/Tools/Common/AkFNVHash.h )
  639. /// Note:
  640. /// This function does return a AkUInt32, which is totally compatible with:
  641. /// AkUniqueID, AkStateGroupID, AkStateID, AkSwitchGroupID, AkSwitchStateID, AkRtpcID, and so on...
  642. /// \sa
  643. /// - <tt>AK::SoundEngine::PostEvent</tt>
  644. /// - <tt>AK::SoundEngine::SetRTPCValue</tt>
  645. /// - <tt>AK::SoundEngine::SetSwitch</tt>
  646. /// - <tt>AK::SoundEngine::SetState</tt>
  647. /// - <tt>AK::SoundEngine::PostTrigger</tt>
  648. /// - <tt>AK::SoundEngine::SetGameObjectAuxSendValues</tt>
  649. /// - <tt>AK::SoundEngine::LoadBank</tt>
  650. /// - <tt>AK::SoundEngine::UnloadBank</tt>
  651. /// - <tt>AK::SoundEngine::PrepareEvent</tt>
  652. /// - <tt>AK::SoundEngine::PrepareGameSyncs</tt>
  653. AK_EXTERNAPIFUNC( AkUInt32, GetIDFromString )( const wchar_t* in_pszString );
  654. #endif //AK_SUPPORT_WCHAR
  655. /// Universal converter from string to ID for the sound engine.
  656. /// This function will hash the name based on a algorithm ( provided at : /AK/Tools/Common/AkFNVHash.h )
  657. /// Note:
  658. /// This function does return a AkUInt32, which is totally compatible with:
  659. /// AkUniqueID, AkStateGroupID, AkStateID, AkSwitchGroupID, AkSwitchStateID, AkRtpcID, and so on...
  660. /// \sa
  661. /// - <tt>AK::SoundEngine::PostEvent</tt>
  662. /// - <tt>AK::SoundEngine::SetRTPCValue</tt>
  663. /// - <tt>AK::SoundEngine::SetSwitch</tt>
  664. /// - <tt>AK::SoundEngine::SetState</tt>
  665. /// - <tt>AK::SoundEngine::PostTrigger</tt>
  666. /// - <tt>AK::SoundEngine::SetGameObjectAuxSendValues</tt>
  667. /// - <tt>AK::SoundEngine::LoadBank</tt>
  668. /// - <tt>AK::SoundEngine::UnloadBank</tt>
  669. /// - <tt>AK::SoundEngine::PrepareEvent</tt>
  670. /// - <tt>AK::SoundEngine::PrepareGameSyncs</tt>
  671. AK_EXTERNAPIFUNC( AkUInt32, GetIDFromString )( const char* in_pszString );
  672. //@}
  673. ////////////////////////////////////////////////////////////////////////
  674. /// @name Event Management
  675. //@{
  676. /// Asynchronously posts an Event to the sound engine (by event ID).
  677. /// The callback function can be used to be noticed when markers are reached or when the event is finished.
  678. /// An array of wave file sources can be provided to resolve External Sources triggered by the event.
  679. /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed and an error will be displayed in the debug console and the Wwise Profiler.
  680. /// \remarks
  681. /// If used, the array of external sources should contain the information for each external source triggered by the
  682. /// event. When triggering an event with multiple external sources, you need to differentiate each source
  683. /// by using the cookie property in the External Source in the Wwise project and in AkExternalSourceInfo.
  684. /// \aknote If an event triggers the playback of more than one external source, they must be named uniquely in the project
  685. /// (therefore have a unique cookie) in order to tell them apart when filling the AkExternalSourceInfo structures.
  686. /// \endaknote
  687. /// \sa
  688. /// - \ref concept_events
  689. /// - \ref integrating_external_sources
  690. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  691. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  692. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  693. AK_EXTERNAPIFUNC( AkPlayingID, PostEvent )(
  694. AkUniqueID in_eventID, ///< Unique ID of the event
  695. AkGameObjectID in_gameObjectID, ///< Associated game object ID
  696. AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
  697. AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
  698. void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information
  699. AkUInt32 in_cExternals = 0, ///< Optional count of external source structures
  700. AkExternalSourceInfo *in_pExternalSources = NULL,///< Optional array of external source resolution information
  701. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID///< Optional (advanced users only) Specify the playing ID to target with the event. Will Cause active actions in this event to target an existing Playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any for normal playback.
  702. );
  703. #ifdef AK_SUPPORT_WCHAR
  704. /// Posts an Event to the sound engine (by Event name), using callbacks.
  705. /// The callback function can be used to be noticed when markers are reached or when the event is finished.
  706. /// An array of wave file sources can be provided to resolve External Sources triggered by the event.
  707. /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed and an error will be displayed in the debug console and the Wwise Profiler.
  708. /// \remarks
  709. /// If used, the array of external sources should contain the information for each external source triggered by the
  710. /// event. When triggering an event with multiple external sources, you need to differentiate each source
  711. /// by using the cookie property in the External Source in the Wwise project and in AkExternalSourceInfo.
  712. /// \aknote If an event triggers the playback of more than one external source, they must be named uniquely in the project
  713. /// (therefore have a unique cookie) in order to tell them appart when filling the AkExternalSourceInfo structures.
  714. /// \endaknote
  715. /// \sa
  716. /// - \ref concept_events
  717. /// - \ref integrating_external_sources
  718. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  719. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  720. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  721. AK_EXTERNAPIFUNC( AkPlayingID, PostEvent )(
  722. const wchar_t* in_pszEventName, ///< Name of the event
  723. AkGameObjectID in_gameObjectID, ///< Associated game object ID
  724. AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
  725. AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
  726. void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information.
  727. AkUInt32 in_cExternals = 0, ///< Optional count of external source structures
  728. AkExternalSourceInfo *in_pExternalSources = NULL,///< Optional array of external source resolution information
  729. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID///< Optional (advanced users only) Specify the playing ID to target with the event. Will Cause active actions in this event to target an existing Playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any for normal playback.
  730. );
  731. #endif //AK_SUPPORT_WCHAR
  732. /// Posts an Event to the sound engine (by Event name), using callbacks.
  733. /// The callback function can be used to be noticed when markers are reached or when the event is finished.
  734. /// An array of Wave file sources can be provided to resolve External Sources triggered by the event. P
  735. /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed and an error will be displayed in the debug console and the Wwise Profiler.
  736. /// \remarks
  737. /// If used, the array of external sources should contain the information for each external source triggered by the
  738. /// event. When triggering an Event with multiple external sources, you need to differentiate each source
  739. /// by using the cookie property in the External Source in the Wwise project and in AkExternalSourceInfo.
  740. /// \aknote If an event triggers the playback of more than one external source, they must be named uniquely in the project
  741. /// (therefore have a unique cookie) in order to tell them apart when filling the AkExternalSourceInfo structures.
  742. /// \endaknote
  743. /// \sa
  744. /// - \ref concept_events
  745. /// - \ref integrating_external_sources
  746. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  747. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  748. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  749. AK_EXTERNAPIFUNC( AkPlayingID, PostEvent )(
  750. const char* in_pszEventName, ///< Name of the event
  751. AkGameObjectID in_gameObjectID, ///< Associated game object ID
  752. AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
  753. AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
  754. void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information.
  755. AkUInt32 in_cExternals = 0, ///< Optional count of external source structures
  756. AkExternalSourceInfo *in_pExternalSources = NULL,///< Optional array of external source resolution information
  757. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID///< Optional (advanced users only) Specify the playing ID to target with the event. Will Cause active actions in this event to target an existing Playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any for normal playback.
  758. );
  759. // If you modify AkActionOnEventType, don't forget to modify the WAAPI validation schema accordingly.
  760. /// AkActionOnEventType
  761. /// \sa
  762. /// - <tt>AK::SoundEngine::ExecuteActionOnEvent()</tt>
  763. enum AkActionOnEventType
  764. {
  765. AkActionOnEventType_Stop = 0, ///< Stop
  766. AkActionOnEventType_Pause = 1, ///< Pause
  767. AkActionOnEventType_Resume = 2, ///< Resume
  768. AkActionOnEventType_Break = 3, ///< Break
  769. AkActionOnEventType_ReleaseEnvelope = 4 ///< Release envelope
  770. };
  771. /// Executes an action on all nodes that are referenced in the specified event in an action of type play.
  772. /// \return
  773. /// - \c AK_Success if the action was successfully queued.
  774. /// - \c AK_IDNotFound if the Event was not found (not loaded or there is a typo in the ID)
  775. /// \sa
  776. /// - <tt>AK::SoundEngine::AkActionOnEventType</tt>
  777. AK_EXTERNAPIFUNC( AKRESULT, ExecuteActionOnEvent )(
  778. AkUniqueID in_eventID, ///< Unique ID of the event
  779. AkActionOnEventType in_ActionType, ///< Action to execute on all the elements that were played using the specified event.
  780. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT, ///< Associated game object ID
  781. AkTimeMs in_uTransitionDuration = 0, ///< Fade duration
  782. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the transition
  783. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Associated PlayingID
  784. );
  785. #ifdef AK_SUPPORT_WCHAR
  786. /// Executes an action on all nodes that are referenced in the specified event in an action of type play.
  787. /// \return
  788. /// - \c AK_Success if the action was successfully queued.
  789. /// - \c AK_IDNotFound if the Event was not found (not loaded or there is a typo in the ID)
  790. /// \sa
  791. /// - <tt>AK::SoundEngine::AkActionOnEventType</tt>
  792. AK_EXTERNAPIFUNC( AKRESULT, ExecuteActionOnEvent )(
  793. const wchar_t* in_pszEventName, ///< Name of the event
  794. AkActionOnEventType in_ActionType, ///< Action to execute on all the elements that were played using the specified event.
  795. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT, ///< Associated game object ID
  796. AkTimeMs in_uTransitionDuration = 0, ///< Fade duration
  797. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the transition
  798. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Associated PlayingID
  799. );
  800. #endif //AK_SUPPORT_WCHAR
  801. /// Executes an Action on all nodes that are referenced in the specified Event in an Action of type Play.
  802. /// \return
  803. /// - \c AK_Success if the action was successfully queued.
  804. /// - \c AK_IDNotFound if the Event was not found (not loaded or there is a typo in the ID)
  805. /// \sa
  806. /// - <tt>AK::SoundEngine::AkActionOnEventType</tt>
  807. AK_EXTERNAPIFUNC( AKRESULT, ExecuteActionOnEvent )(
  808. const char* in_pszEventName, ///< Name of the event
  809. AkActionOnEventType in_ActionType, ///< Action to execute on all the elements that were played using the specified event.
  810. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT, ///< Associated game object ID
  811. AkTimeMs in_uTransitionDuration = 0, ///< Fade duration
  812. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the transition
  813. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Associated PlayingID
  814. );
  815. /// Executes a number of MIDI Events on all nodes that are referenced in the specified Event in an Action of type Play.
  816. /// The time at which a MIDI Event is posted is determined by in_bAbsoluteOffsets. If false, each MIDI event will be
  817. /// posted in AkMIDIPost::uOffset samples from the start of the current frame. If true, each MIDI event will be posted
  818. /// at the absolute time AkMIDIPost::uOffset samples.
  819. /// To obtain the current absolute time, see AK::SoundEngine::GetSampleTick.
  820. /// The duration of a sample can be determined from the sound engine's audio settings, via a call to AK::SoundEngine::GetAudioSettings.
  821. /// If a playing ID is specified then that playing ID must be active. Otherwise a new playing ID will be assigned.
  822. /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed and an error will be displayed in the debug console and the Wwise Profiler.
  823. /// \sa
  824. /// - <tt>AK::SoundEngine::GetAudioSettings</tt>
  825. /// - <tt>AK::SoundEngine::GetSampleTick</tt>
  826. /// - <tt>AK::SoundEngine::StopMIDIOnEvent</tt>
  827. /// - \ref soundengine_midi_event_playing_id
  828. AK_EXTERNAPIFUNC( AkPlayingID, PostMIDIOnEvent )(
  829. AkUniqueID in_eventID, ///< Unique ID of the Event
  830. AkGameObjectID in_gameObjectID, ///< Associated game object ID
  831. AkMIDIPost* in_pPosts, ///< MIDI Events to post
  832. AkUInt16 in_uNumPosts, ///< Number of MIDI Events to post
  833. bool in_bAbsoluteOffsets = false, ///< Set to true when AkMIDIPost::uOffset are absolute, false when relative to current frame
  834. AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
  835. AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
  836. void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information
  837. AkPlayingID in_playingID = AK_INVALID_PLAYING_ID ///< Target playing ID
  838. );
  839. /// Stops MIDI notes on all nodes that are referenced in the specified event in an action of type play,
  840. /// with the specified Game Object. Invalid parameters are interpreted as wildcards. For example, calling
  841. /// this function with in_eventID set to AK_INVALID_UNIQUE_ID will stop all MIDI notes for Game Object
  842. /// in_gameObjectID.
  843. /// \return
  844. /// - \c AK_Success if the stop command was queued
  845. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  846. /// \sa
  847. /// - <tt>AK::SoundEngine::PostMIDIOnEvent</tt>
  848. /// - \ref soundengine_midi_event_playing_id
  849. AK_EXTERNAPIFUNC( AKRESULT, StopMIDIOnEvent )(
  850. AkUniqueID in_eventID = AK_INVALID_UNIQUE_ID, ///< Unique ID of the Event
  851. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT, ///< Associated game object ID
  852. AkPlayingID in_playingID = AK_INVALID_PLAYING_ID ///< Target playing ID
  853. );
  854. /// Starts streaming the first part of all streamed files referenced by an Event into a cache buffer. Caching streams are serviced when no other streams require the
  855. /// available bandwidth. The files will remain cached until UnpinEventInStreamCache is called, or a higher priority pinned file needs the space and the limit set by
  856. /// uMaxCachePinnedBytes is exceeded.
  857. /// \remarks The amount of data from the start of the file that will be pinned to cache is determined by the prefetch size. The prefetch size is set via the authoring tool and stored in the sound banks.
  858. /// \remarks It is possible to override the prefetch size stored in the sound bank via the low level IO. For more information see <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> and AkFileSystemFlags.
  859. /// \remarks If this function is called additional times with the same event, then the priority of the caching streams are updated. Note however that priority is passed down to the stream manager
  860. /// on a file-by-file basis, and if another event is pinned to cache that references the same file but with a different priority, then the first priority will be updated with the most recent value.
  861. /// \remarks If the event references files that are chosen based on a State Group (via a switch container), all files in all states will be cached. Those in the current active state
  862. /// will get cached with active priority, while all other files will get cached with inactive priority.
  863. /// \remarks in_uInactivePriority is only relevant for events that reference switch containers that are assigned to State Groups. This parameter is ignored for all other events, including events that only reference
  864. /// switch containers that are assigned to Switch Groups. Files that are chosen based on a Switch Group have a different switch value per game object, and are all effectively considered active by the pin-to-cache system.
  865. /// \return
  866. /// - \c AK_Success if command was queued
  867. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  868. /// \sa
  869. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  870. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  871. /// - <tt>AK::StreamMgr::IAkFileLocationResolver::Open</tt>
  872. /// - AkFileSystemFlags
  873. AK_EXTERNAPIFUNC( AKRESULT, PinEventInStreamCache )(
  874. AkUniqueID in_eventID, ///< Unique ID of the event
  875. AkPriority in_uActivePriority, ///< Priority of active stream caching I/O
  876. AkPriority in_uInactivePriority ///< Priority of inactive stream caching I/O
  877. );
  878. #ifdef AK_SUPPORT_WCHAR
  879. /// Starts streaming the first part of all streamed files referenced by an event into a cache buffer. Caching streams are serviced when no other streams require the
  880. /// available bandwidth. The files will remain cached until UnpinEventInStreamCache is called, or a higher priority pinned file needs the space and the limit set by
  881. /// uMaxCachePinnedBytes is exceeded.
  882. /// \remarks The amount of data from the start of the file that will be pinned to cache is determined by the prefetch size. The prefetch size is set via the authoring tool and stored in the sound banks.
  883. /// \remarks It is possible to override the prefetch size stored in the sound bank via the low level IO. For more information see <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> and AkFileSystemFlags.
  884. /// \remarks If this function is called additional times with the same event, then the priority of the caching streams are updated. Note however that priority is passed down to the stream manager
  885. /// on a file-by-file basis, and if another event is pinned to cache that references the same file but with a different priority, then the first priority will be updated with the most recent value.
  886. /// \remarks If the event references files that are chosen based on a State Group (via a Switch Container), all files in all states will be cached. Those in the current active state
  887. /// will get cached with active priority, while all other files will get cached with inactive priority.
  888. /// \remarks in_uInactivePriority is only relevant for events that reference switch containers that are assigned to State Groups. This parameter is ignored for all other events, including events that only reference
  889. /// switch containers that are assigned to Switch Groups. Files that are chosen based on a Switch Group have a different switch value per game object, and are all effectively considered active by the pin-to-cache system.
  890. /// \return
  891. /// - \c AK_Success if command was queued
  892. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  893. /// \sa
  894. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  895. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  896. /// - <tt>AK::StreamMgr::IAkFileLocationResolver::Open</tt>
  897. /// - AkFileSystemFlags
  898. AK_EXTERNAPIFUNC( AKRESULT, PinEventInStreamCache )(
  899. const wchar_t* in_pszEventName, ///< Name of the event
  900. AkPriority in_uActivePriority, ///< Priority of active stream caching I/O
  901. AkPriority in_uInactivePriority ///< Priority of inactive stream caching I/O
  902. );
  903. #endif //AK_SUPPORT_WCHAR
  904. /// Starts streaming the first part of all streamed files referenced by an event into a cache buffer. Caching streams are serviced when no other streams require the
  905. /// available bandwidth. The files will remain cached until UnpinEventInStreamCache is called, or a higher priority pinned file needs the space and the limit set by
  906. /// uMaxCachePinnedBytes is exceeded.
  907. /// \remarks The amount of data from the start of the file that will be pinned to cache is determined by the prefetch size. The prefetch size is set via the authoring tool and stored in the sound banks.
  908. /// \remarks It is possible to override the prefetch size stored in the sound bank via the low level IO. For more information see <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> and AkFileSystemFlags.
  909. /// \remarks If this function is called additional times with the same event, then the priority of the caching streams are updated. Note however that priority is passed down to the stream manager
  910. /// on a file-by-file basis, and if another event is pinned to cache that references the same file but with a different priority, then the first priority will be updated with the most recent value.
  911. /// \remarks If the event references files that are chosen based on a State Group (via a switch container), all files in all states will be cached. Those in the current active state
  912. /// will get cached with active priority, while all other files will get cached with inactive priority.
  913. /// \remarks in_uInactivePriority is only relevant for events that reference switch containers that are assigned to State Groups. This parameter is ignored for all other events, including events that only reference
  914. /// switch containers that are assigned to Switch Groups. Files that are chosen based on a Switch Group have a different switch value per game object, and are all effectively considered active by the pin-to-cache system.
  915. /// \return
  916. /// - \c AK_Success if command was queued
  917. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  918. /// \sa
  919. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  920. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  921. /// - <tt>AK::StreamMgr::IAkFileLocationResolver::Open</tt>
  922. /// - AkFileSystemFlags
  923. AK_EXTERNAPIFUNC( AKRESULT, PinEventInStreamCache )(
  924. const char* in_pszEventName, ///< Name of the event
  925. AkPriority in_uActivePriority, ///< Priority of active stream caching I/O
  926. AkPriority in_uInactivePriority ///< Priority of inactive stream caching I/O
  927. );
  928. /// Releases the set of files that were previously requested to be pinned into cache via <tt>AK::SoundEngine::PinEventInStreamCache()</tt>. The file may still remain in stream cache
  929. /// after <tt>AK::SoundEngine::UnpinEventInStreamCache()</tt> is called, until the memory is reused by the streaming memory manager in accordance with to its cache management algorithm.
  930. /// \return
  931. /// - \c AK_Success if command was queued
  932. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  933. /// \sa
  934. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  935. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  936. AK_EXTERNAPIFUNC( AKRESULT, UnpinEventInStreamCache )(
  937. AkUniqueID in_eventID ///< Unique ID of the event
  938. );
  939. #ifdef AK_SUPPORT_WCHAR
  940. /// Releases the set of files that were previously requested to be pinned into cache via <tt>AK::SoundEngine::PinEventInStreamCache()</tt>. The file may still remain in stream cache
  941. /// after <tt>AK::SoundEngine::UnpinEventInStreamCache()</tt> is called, until the memory is reused by the streaming memory manager in accordance with to its cache management algorithm.
  942. /// \return
  943. /// - \c AK_Success if command was queued
  944. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  945. /// \sa
  946. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  947. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  948. AK_EXTERNAPIFUNC( AKRESULT, UnpinEventInStreamCache )(
  949. const wchar_t* in_pszEventName ///< Name of the event
  950. );
  951. #endif //AK_SUPPORT_WCHAR
  952. /// Releases the set of files that were previously requested to be pinned into cache via <tt>AK::SoundEngine::PinEventInStreamCache()</tt>. The file may still remain in stream cache
  953. /// after <tt>AK::SoundEngine::UnpinEventInStreamCache()</tt> is called, until the memory is reused by the streaming memory manager in accordance with to its cache management algorithm.
  954. /// \return
  955. /// - \c AK_Success if command was queued
  956. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  957. /// \sa
  958. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  959. /// - <tt>AK::SoundEngine::GetBufferStatusForPinnedEvent</tt>
  960. AK_EXTERNAPIFUNC( AKRESULT, UnpinEventInStreamCache )(
  961. const char* in_pszEventName ///< Name of the event
  962. );
  963. /// Returns information about an Event that was requested to be pinned into cache via <tt>AK::SoundEngine::PinEventInStreamCache()</tt>.
  964. /// Retrieves the smallest buffer fill-percentage for each file referenced by the event, and whether
  965. /// the cache-pinned memory limit is preventing any of the files from filling up their buffer.
  966. /// \remarks To set the limit for the maximum number of bytes that can be pinned to cache, see \c AkDeviceSettings
  967. /// \return
  968. /// - \c AK_Success if command was queued
  969. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  970. /// \sa
  971. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  972. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  973. /// - AkDeviceSettings
  974. AK_EXTERNAPIFUNC( AKRESULT, GetBufferStatusForPinnedEvent )(
  975. AkUniqueID in_eventID, ///< Unique ID of the event
  976. AkReal32& out_fPercentBuffered, ///< Fill-percentage (out of 100) of requested buffer size for least buffered file in the event.
  977. bool& out_bCachePinnedMemoryFull ///< True if at least one file can not complete buffering because the cache-pinned memory limit would be exceeded.
  978. );
  979. /// Returns information about an Event that was requested to be pinned into cache via \c <tt>AK::SoundEngine::PinEventInStreamCache()</tt>.
  980. /// Retrieves the smallest buffer fill-percentage for each file referenced by the event, and whether
  981. /// the cache-pinned memory limit is preventing any of the files from filling up their buffer.
  982. /// \remarks To set the limit for the maximum number of bytes that can be pinned to cache, see AkDeviceSettings
  983. /// \return
  984. /// - \c AK_Success if command was queued
  985. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  986. /// \sa
  987. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  988. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  989. /// - AkDeviceSettings
  990. AK_EXTERNAPIFUNC( AKRESULT, GetBufferStatusForPinnedEvent )(
  991. const char* in_pszEventName, ///< Name of the event
  992. AkReal32& out_fPercentBuffered, ///< Fill-percentage (out of 100) of requested buffer size for least buffered file in the event.
  993. bool& out_bCachePinnedMemoryFull ///< True if at least one file can not complete buffering because the cache-pinned memory limit would be exceeded.
  994. );
  995. #ifdef AK_SUPPORT_WCHAR
  996. /// Returns information about an Event that was requested to be pinned into cache via \c <tt>AK::SoundEngine::PinEventInStreamCache()</tt>.
  997. /// Retrieves the smallest buffer fill-percentage for each file referenced by the event, and whether
  998. /// the cache-pinned memory limit is preventing any of the files from filling up their buffer.
  999. /// \remarks To set the limit for the maximum number of bytes that can be pinned to cache, see AkDeviceSettings
  1000. /// \return
  1001. /// - \c AK_Success if command was queued
  1002. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  1003. /// \sa
  1004. /// - <tt>AK::SoundEngine::PinEventInStreamCache</tt>
  1005. /// - <tt>AK::SoundEngine::UnpinEventInStreamCache</tt>
  1006. /// - AkDeviceSettings
  1007. AK_EXTERNAPIFUNC( AKRESULT, GetBufferStatusForPinnedEvent )(
  1008. const wchar_t* in_pszEventName, ///< Name of the event
  1009. AkReal32& out_fPercentBuffered, ///< Fill-percentage (out of 100) of requested buffer size for least buffered file in the event.
  1010. bool& out_bCachePinnedMemoryFull ///< True if at least one file can not complete buffering because the cache-pinned memory limit would be exceeded.
  1011. );
  1012. #endif
  1013. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1014. ///
  1015. /// Notes:
  1016. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1017. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1018. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1019. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1020. /// the sound that is currently playing is the first sound of the sequence.
  1021. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1022. /// - Sounds/segments are stopped if in_iPosition is greater than their duration.
  1023. /// - in_iPosition is clamped internally to the beginning of the sound/segment.
  1024. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1025. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1026. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1027. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1028. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1029. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1030. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1031. /// the audio thread consumes it (after a call to RenderAudio()).
  1032. ///
  1033. /// Notes specific to Music Segments:
  1034. /// - With Music Segments, in_iPosition is relative to the Entry Cue, in milliseconds. Use a negative
  1035. /// value to seek within the Pre-Entry.
  1036. /// - Music segments cannot be looped. You may want to listen to the AK_EndOfEvent notification
  1037. /// in order to restart them if required.
  1038. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1039. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1040. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1041. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1042. /// the exact position of a segment. Also, the segment will be silent during that time
  1043. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1044. /// also informs you about the remaining look-ahead time.
  1045. ///
  1046. /// Notes specific to Music Switch Containers:
  1047. /// - Seeking triggers a music transition towards the current (or target) segment.
  1048. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1049. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1050. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1051. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1052. ///
  1053. /// \return
  1054. /// - \c AK_Success if command was queued
  1055. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  1056. /// \sa
  1057. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1058. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1059. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1060. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1061. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1062. AkUniqueID in_eventID, ///< Unique ID of the event
  1063. AkGameObjectID in_gameObjectID, ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1064. AkTimeMs in_iPosition, ///< Desired position where playback should restart, in milliseconds
  1065. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see note above)
  1066. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1067. );
  1068. #ifdef AK_SUPPORT_WCHAR
  1069. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1070. ///
  1071. /// Notes:
  1072. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1073. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1074. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1075. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1076. /// the sound that is currently playing is the first sound of the sequence.
  1077. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1078. /// - With Music Segments, in_iPosition is relative to the Entry Cue, in milliseconds. Use a negative
  1079. /// value to seek within the Pre-Entry.
  1080. /// - Sounds/segments are stopped if in_iPosition is greater than their duration.
  1081. /// - in_iPosition is clamped internally to the beginning of the sound/segment.
  1082. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1083. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1084. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1085. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1086. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1087. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1088. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1089. /// the audio thread consumes it (after a call to RenderAudio()).
  1090. ///
  1091. /// Notes specific to Music Segments:
  1092. /// - With Music Segments, in_iPosition is relative to the Entry Cue, in milliseconds. Use a negative
  1093. /// value to seek within the Pre-Entry.
  1094. /// - Music segments cannot be looped. You may want to listen to the AK_EndOfEvent notification
  1095. /// in order to restart them if required.
  1096. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1097. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1098. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1099. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1100. /// the exact position of a segment. Also, the segment will be silent during that time
  1101. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1102. /// also informs you about the remaining look-ahead time.
  1103. ///
  1104. /// Notes specific to Music Switch Containers:
  1105. /// - Seeking triggers a music transition towards the current (or target) segment.
  1106. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1107. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1108. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1109. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1110. /// \return
  1111. /// - \c AK_Success if command was queued
  1112. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  1113. /// \sa
  1114. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1115. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1116. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1117. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1118. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1119. const wchar_t* in_pszEventName, ///< Name of the event
  1120. AkGameObjectID in_gameObjectID, ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1121. AkTimeMs in_iPosition, ///< Desired position where playback should restart, in milliseconds
  1122. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see note above)
  1123. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1124. );
  1125. #endif //AK_SUPPORT_WCHAR
  1126. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1127. ///
  1128. /// Notes:
  1129. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1130. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1131. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1132. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1133. /// the sound that is currently playing is the first sound of the sequence.
  1134. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1135. /// - With Music Segments, in_iPosition is relative to the Entry Cue, in milliseconds. Use a negative
  1136. /// value to seek within the Pre-Entry.
  1137. /// - Sounds/segments are stopped if in_iPosition is greater than their duration.
  1138. /// - in_iPosition is clamped internally to the beginning of the sound/segment.
  1139. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1140. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1141. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1142. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1143. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1144. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1145. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1146. /// the audio thread consumes it (after a call to RenderAudio()).
  1147. ///
  1148. /// Notes specific to Music Segments:
  1149. /// - With Music Segments, in_iPosition is relative to the Entry Cue, in milliseconds. Use a negative
  1150. /// value to seek within the Pre-Entry.
  1151. /// - Music segments cannot be looped. You may want to listen to the AK_EndOfEvent notification
  1152. /// in order to restart them if required.
  1153. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1154. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1155. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1156. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1157. /// the exact position of a segment. Also, the segment will be silent during that time
  1158. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1159. /// also informs you about the remaining look-ahead time.
  1160. ///
  1161. /// Notes specific to Music Switch Containers:
  1162. /// - Seeking triggers a music transition towards the current (or target) segment.
  1163. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1164. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1165. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1166. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1167. ///
  1168. /// \return
  1169. /// - \c AK_Success if command was queued
  1170. /// - \c AK_IDNotFound if the Event ID is unknown (not loaded or typo in the ID)
  1171. /// \sa
  1172. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1173. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1174. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1175. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1176. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1177. const char* in_pszEventName, ///< Name of the event
  1178. AkGameObjectID in_gameObjectID, ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1179. AkTimeMs in_iPosition, ///< Desired position where playback should restart, in milliseconds
  1180. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see note above)
  1181. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1182. );
  1183. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1184. /// Seek position is specified as a percentage of the sound's total duration, and takes looping into account.
  1185. ///
  1186. /// Notes:
  1187. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1188. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1189. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1190. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1191. /// the sound that is currently playing is the first sound of the sequence.
  1192. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1193. /// - in_iPosition is clamped internally to the beginning of the sound/segment.
  1194. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1195. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1196. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1197. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1198. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1199. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1200. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1201. /// the audio thread consumes it (after a call to RenderAudio()).
  1202. ///
  1203. /// Notes specific to Music Segments:
  1204. /// - With Music Segments, \c in_fPercent is relative to the Entry Cue, and the segment's duration is the
  1205. /// duration between its entry and exit cues. Consequently, you cannot seek within the pre-entry or
  1206. /// post-exit of a segment using this method. Use absolute values instead.
  1207. /// - Music Segments cannot be looped. You may want to listen to the \c AK_EndOfEvent notification
  1208. /// in order to restart them if required.
  1209. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1210. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1211. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1212. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1213. /// the exact position of a segment. Also, the segment will be silent during the time that period
  1214. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1215. /// also informs you about the remaining look-ahead time.
  1216. ///
  1217. /// Notes specific to Music Switch Containers:
  1218. /// - Seeking triggers a music transition towards the current (or target) segment.
  1219. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1220. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1221. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1222. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1223. ///
  1224. /// \sa
  1225. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1226. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1227. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1228. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1229. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1230. AkUniqueID in_eventID, ///< Unique ID of the event
  1231. AkGameObjectID in_gameObjectID , ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1232. AkReal32 in_fPercent, ///< Desired position where playback should restart, expressed in a percentage of the file's total duration, between 0 and 1.f (see note above about infinite looping sounds)
  1233. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see note above)
  1234. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1235. );
  1236. #ifdef AK_SUPPORT_WCHAR
  1237. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1238. /// Seek position is specified as a percentage of the sound's total duration, and takes looping into account.
  1239. ///
  1240. /// Notes:
  1241. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1242. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1243. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1244. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1245. /// the sound that is currently playing is the first sound of the sequence.
  1246. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1247. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1248. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1249. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1250. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1251. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1252. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1253. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1254. /// the audio thread consumes it (after a call to RenderAudio()).
  1255. ///
  1256. /// Notes specific to Music Segments:
  1257. /// - With Music Segments, \c in_fPercent is relative to the Entry Cue, and the segment's duration is the
  1258. /// duration between its entry and exit cues. Consequently, you cannot seek within the pre-entry or
  1259. /// post-exit of a segment using this method. Use absolute values instead.
  1260. /// - Music Segments cannot be looped. You may want to listen to the \c AK_EndOfEvent notification
  1261. /// in order to restart them if required.
  1262. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1263. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1264. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1265. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1266. /// the exact position of a segment. Also, the segment will be silent during the time that period
  1267. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1268. /// also informs you about the remaining look-ahead time.
  1269. ///
  1270. /// Notes specific to Music Switch Containers:
  1271. /// - Seeking triggers a music transition towards the current (or target) segment.
  1272. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1273. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1274. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1275. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1276. ///
  1277. /// \sa
  1278. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1279. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1280. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1281. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1282. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1283. const wchar_t* in_pszEventName, ///< Name of the event
  1284. AkGameObjectID in_gameObjectID , ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1285. AkReal32 in_fPercent , ///< Desired position where playback should restart, expressed in a percentage of the file's total duration, between 0 and 1.f (see note above about infinite looping sounds)
  1286. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see note above)
  1287. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1288. );
  1289. #endif //AK_SUPPORT_WCHAR
  1290. /// Seeks inside all playing objects that are referenced in Play Actions of the specified Event.
  1291. /// Seek position is specified as a percentage of the sound's total duration, and takes looping into account.
  1292. ///
  1293. /// Notes:
  1294. /// - This works with all objects of the actor-mixer hierarchy, and also with Music Segments and Music Switch Containers.
  1295. /// - There is a restriction with sounds that play within a continuous sequence. Seeking is ignored
  1296. /// if one of their ancestors is a continuous (random or sequence) container with crossfade or
  1297. /// trigger rate transitions. Seeking is also ignored with sample-accurate transitions, unless
  1298. /// the sound that is currently playing is the first sound of the sequence.
  1299. /// - Seeking is also ignored with voices that can go virtual with "From Beginning" behavior.
  1300. /// - If the option "Seek to nearest marker" is used, the seeking position snaps to the nearest marker.
  1301. /// With objects of the actor-mixer hierarchy, markers are embedded in wave files by an external wave editor.
  1302. /// Note that looping regions ("sampler loop") are not considered as markers. Also, the "add file name marker" of the
  1303. /// conversion settings dialog adds a marker at the beginning of the file, which is considered when seeking
  1304. /// to nearest marker. In the case of objects of the interactive music hierarchy, user (wave) markers are ignored:
  1305. /// seeking occurs to the nearest segment cue (authored in the segment editor), including the Entry Cue, but excluding the Exit Cue.
  1306. /// - This method posts a command in the sound engine queue, thus seeking will not occur before
  1307. /// the audio thread consumes it (after a call to RenderAudio()).
  1308. ///
  1309. /// Notes specific to Music Segments:
  1310. /// - With Music Segments, in_fPercent is relative to the Entry Cue, and the segment's duration is the
  1311. /// duration between its entry and exit cues. Consequently, you cannot seek within the pre-entry or
  1312. /// post-exit of a segment using this method. Use absolute values instead.
  1313. /// - Music segments cannot be looped. You may want to listen to the AK_EndOfEvent notification
  1314. /// in order to restart them if required.
  1315. /// - In order to restart at the correct location, with all their tracks synchronized, Music Segments
  1316. /// take the "look-ahead time" property of their streamed tracks into account for seeking.
  1317. /// Consequently, the resulting position after a call to SeekOnEvent() might be earlier than the
  1318. /// value that was passed to the method. Use <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt> to query
  1319. /// the exact position of a segment. Also, the segment will be silent during the time that period
  1320. /// (so that it restarts precisely at the position that you specified). <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1321. /// also informs you about the remaining look-ahead time.
  1322. ///
  1323. /// Notes specific to Music Switch Containers:
  1324. /// - Seeking triggers a music transition towards the current (or target) segment.
  1325. /// This transition is subject to the container's transition rule that matches the current and defined in the container,
  1326. /// so the moment when seeking occurs depends on the rule's "Exit At" property. On the other hand, the starting position
  1327. /// in the target segment depends on both the desired seeking position and the rule's "Sync To" property.
  1328. /// - If the specified time is greater than the destination segment's length, the modulo is taken.
  1329. ///
  1330. /// \sa
  1331. /// - <tt>AK::SoundEngine::RenderAudio()</tt>
  1332. /// - <tt>AK::SoundEngine::PostEvent()</tt>
  1333. /// - <tt>AK::SoundEngine::GetSourcePlayPosition()</tt>
  1334. /// - <tt>AK::MusicEngine::GetPlayingSegmentInfo()</tt>
  1335. AK_EXTERNAPIFUNC( AKRESULT, SeekOnEvent )(
  1336. const char* in_pszEventName, ///< Name of the event
  1337. AkGameObjectID in_gameObjectID, ///< Associated game object ID; use AK_INVALID_GAME_OBJECT to affect all game objects
  1338. AkReal32 in_fPercent, ///< Desired position where playback should restart, expressed in a percentage of the file's total duration, between 0 and 1.f (see note above about infinite looping sounds)
  1339. bool in_bSeekToNearestMarker = false, ///< If true, the final seeking position will be made equal to the nearest marker (see notes above).
  1340. AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID ///< Specify the playing ID for the seek to be applied to. Will result in the seek happening only on active actions of the playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any, to seek on all active actions of this event ID.
  1341. );
  1342. /// Cancels all Event callbacks associated with a specific callback cookie.\n
  1343. /// \sa
  1344. /// - \c <tt>AK::SoundEngine::PostEvent()</tt>
  1345. AK_EXTERNAPIFUNC( void, CancelEventCallbackCookie )(
  1346. void * in_pCookie ///< Callback cookie to be cancelled
  1347. );
  1348. /// Cancels all Event callbacks associated with a specific game object.\n
  1349. /// \sa
  1350. /// - \c <tt>AK::SoundEngine::PostEvent()</tt>
  1351. AK_EXTERNAPIFUNC( void, CancelEventCallbackGameObject )(
  1352. AkGameObjectID in_gameObjectID ///< ID of the game object to be cancelled
  1353. );
  1354. /// Cancels all Event callbacks for a specific playing ID.
  1355. /// \sa
  1356. /// - \c <tt>AK::SoundEngine::PostEvent()</tt>
  1357. AK_EXTERNAPIFUNC( void, CancelEventCallback )(
  1358. AkPlayingID in_playingID ///< Playing ID of the event that must not use callbacks
  1359. );
  1360. /// Gets the current position of the source associated with this playing ID, obtained from PostEvent(). If more than one source is playing,
  1361. /// the first to play is returned.
  1362. /// Notes:
  1363. /// - You need to pass AK_EnableGetSourcePlayPosition to PostEvent() in order to use this function, otherwise
  1364. /// it returns AK_Fail, even if the playing ID is valid.
  1365. /// - The source's position is updated at every audio frame, and the time at which this occurs is stored.
  1366. /// When you call this function from your thread, you therefore query the position that was updated in the previous audio frame.
  1367. /// If in_bExtrapolate is true (default), the returned position is extrapolated using the elapsed time since last
  1368. /// sound engine update and the source's playback rate.
  1369. /// \return
  1370. /// - \c AK_Success if successful.
  1371. /// - \c AK_InvalidParameter if the provided pointer is not valid.
  1372. /// - \c AK_PlayingIDNotFound if the playing ID is invalid (not playing yet, or finished playing).
  1373. /// \sa
  1374. /// - \ref soundengine_query_pos
  1375. /// - \ref concept_events
  1376. AK_EXTERNAPIFUNC( AKRESULT, GetSourcePlayPosition )(
  1377. AkPlayingID in_PlayingID, ///< Playing ID returned by <tt>AK::SoundEngine::PostEvent()</tt>
  1378. AkTimeMs* out_puPosition, ///< Position of the source (in ms) associated with the specified playing ID
  1379. bool in_bExtrapolate = true ///< Position is extrapolated based on time elapsed since last sound engine update.
  1380. );
  1381. /// Gets the current position of the sources associated with this playing ID, obtained from PostEvent().
  1382. /// Notes:
  1383. /// - You need to pass AK_EnableGetSourcePlayPosition to PostEvent() in order to use this function, otherwise
  1384. /// it returns AK_Fail, even if the playing ID is valid.
  1385. /// - The source's position is updated at every audio frame, and the time at which this occurs is stored.
  1386. /// When you call this function from your thread, you therefore query the position that was updated in the previous audio frame.
  1387. /// If in_bExtrapolate is true (default), the returned position is extrapolated using the elapsed time since last
  1388. /// sound engine update and the source's playback rate.
  1389. /// - If 0 is passed in for the number of entries (*in_pcPositions == 0) then only the number of positions will be returned and the
  1390. /// position array (out_puPositions) will not be updated.
  1391. /// - The io_pcPositions pointer must be non-NULL.
  1392. /// out_puPositions may be NULL if *io_pcPositions == 0, otherwise it must be non-NULL.
  1393. /// \return
  1394. /// - \c AK_Success if successful.
  1395. /// - \c AK_InvalidParameter if the provided pointer is not valid.
  1396. /// - \c AK_PlayingIDNotFound if the playing ID is invalid (not playing yet, or finished playing).
  1397. /// \sa
  1398. /// - \ref soundengine_query_pos
  1399. /// - \ref concept_events
  1400. AK_EXTERNAPIFUNC(AKRESULT, GetSourcePlayPositions)(
  1401. AkPlayingID in_PlayingID, ///< Playing ID returned by <tt>AK::SoundEngine::PostEvent()</tt>
  1402. AkSourcePosition* out_puPositions, ///< Audio Node IDs and positions of sources associated with the specified playing ID
  1403. AkUInt32 * io_pcPositions, ///< Number of entries in out_puPositions. Needs to be set to the size of the array: it is adjusted to the actual number of returned entries
  1404. bool in_bExtrapolate = true ///< Position is extrapolated based on time elapsed since last sound engine update
  1405. );
  1406. /// Gets the stream buffering of the sources associated with this playing ID, obtained from PostEvent().
  1407. /// Notes:
  1408. /// - You need to pass AK_EnableGetSourceStreamBuffering to PostEvent() in order to use this function, otherwise
  1409. /// it returns AK_Fail, even if the playing ID is valid.
  1410. /// - The sources stream buffering is updated at every audio frame. If there are multiple sources associated with this playing ID,
  1411. /// the value returned corresponds to the least buffered source.
  1412. /// - The returned buffering status out_bIsBuffering will be true If any of the sources associated with the playing ID are actively being buffered.
  1413. /// It will be false if all of them have reached the end of file, or have reached a state where they are buffered enough and streaming is temporarily idle.
  1414. /// - Purely in-memory sources are excluded from this database. If all sources are in-memory, GetSourceStreamBuffering() will return AK_Fail.
  1415. /// - The returned buffering amount and state is not completely accurate with some hardware-accelerated codecs. In such cases, the amount of stream buffering is generally underestimated.
  1416. /// On the other hand, it is not guaranteed that the source will be ready to produce data at the next audio frame even if out_bIsBuffering has turned to false.
  1417. /// \return
  1418. /// - \c AK_Success if successful.
  1419. /// - \c AK_PlayingIDNotFound if the source data associated with this playing ID is not found, for example if PostEvent() was not called with AK_EnableGetSourceStreamBuffering, or if the header was not parsed.
  1420. /// \sa
  1421. /// - \ref concept_events
  1422. AK_EXTERNAPIFUNC( AKRESULT, GetSourceStreamBuffering )(
  1423. AkPlayingID in_PlayingID, ///< Playing ID returned by <tt>AK::SoundEngine::PostEvent()</tt>
  1424. AkTimeMs & out_buffering, ///< Returned amount of buffering (in ms) of the source (or one of the sources) associated with that playing ID
  1425. bool & out_bIsBuffering ///< Returned buffering status of the source(s) associated with that playing ID
  1426. );
  1427. /// Stops the current content playing associated to the specified game object ID.
  1428. /// If no game object is specified, all sounds will be stopped.
  1429. AK_EXTERNAPIFUNC( void, StopAll )(
  1430. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< (Optional)Specify a game object to stop only playback associated to the provided game object ID.
  1431. );
  1432. /// Stop the current content playing associated to the specified playing ID.
  1433. /// \aknote
  1434. /// This function is deprecated. Please use ExecuteActionOnPlayingID() in its place.
  1435. /// \endaknote
  1436. /// \sa
  1437. /// - <tt>AK::SoundEngine::ExecuteActionOnPlayingID()</tt>
  1438. AK_EXTERNAPIFUNC( void, StopPlayingID )(
  1439. AkPlayingID in_playingID, ///< Playing ID to be stopped.
  1440. AkTimeMs in_uTransitionDuration = 0, ///< Fade duration
  1441. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear ///< Curve type to be used for the transition
  1442. );
  1443. /// Executes an Action on the content associated to the specified playing ID.
  1444. /// \sa
  1445. /// - <tt>AK::SoundEngine::AkActionOnEventType</tt>
  1446. AK_EXTERNAPIFUNC(void, ExecuteActionOnPlayingID)(
  1447. AkActionOnEventType in_ActionType, ///< Action to execute on the specified playing ID.
  1448. AkPlayingID in_playingID, ///< Playing ID on which to execute the action.
  1449. AkTimeMs in_uTransitionDuration = 0, ///< Fade duration
  1450. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear ///< Curve type to be used for the transition
  1451. );
  1452. /// Sets the random seed value. Can be used to synchronize randomness
  1453. /// across instances of the Sound Engine.
  1454. /// \remark This seeds the number generator used for all container randomizations
  1455. /// and the plug-in RNG; since it acts globally, this should be called right
  1456. /// before any PostEvent call where randomness synchronization is required,
  1457. /// and cannot guarantee similar results for continuous containers.
  1458. /// \sa
  1459. /// - <tt>AK::IAkPluginServiceRNG</tt>
  1460. AK_EXTERNAPIFUNC( void, SetRandomSeed )(
  1461. AkUInt32 in_uSeed ///< Random seed.
  1462. );
  1463. /// Mutes/Unmutes the busses tagged as background music.
  1464. /// This is automatically called for platforms that have user-music support.
  1465. /// This function is provided to give the same behavior on platforms that don't have user-music support.
  1466. AK_EXTERNAPIFUNC( void, MuteBackgroundMusic ) (
  1467. bool in_bMute ///< Sets true to mute, false to unmute.
  1468. );
  1469. //@}
  1470. /// Gets the state of the Background Music busses. This state is either set directly
  1471. /// with \c AK::SoundEngine::MuteBackgroundMusic or by the OS, if it has User Music services.
  1472. /// \return true if the background music busses are muted, false if not.
  1473. AK_EXTERNAPIFUNC(bool, GetBackgroundMusicMute) ();
  1474. //@}
  1475. /// Sends custom game data to a plug-in that resides on a bus (insert Effect or mixer plug-in).
  1476. /// Data will be copied and stored into a separate list.
  1477. /// Previous entry is deleted when a new one is sent.
  1478. /// Sets the data pointer to NULL to clear item from the list.
  1479. /// \aknote The plug-in type and ID is passed and matched with plugins set on the desired bus.
  1480. /// This means that you cannot send different data to various instances of the plug-in on a same bus.\endaknote
  1481. /// \return AK_Success if data was sent successfully.
  1482. AK_EXTERNAPIFUNC( AKRESULT, SendPluginCustomGameData ) (
  1483. AkUniqueID in_busID, ///< Bus ID
  1484. AkGameObjectID in_busObjectID, ///< Bus Object ID. Pass AK_INVALID_GAME_OBJECT to send custom data with global scope. Game object scope supersedes global scope, as with RTPCs.
  1485. AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
  1486. AkUInt32 in_uCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
  1487. AkUInt32 in_uPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
  1488. const void* in_pData, ///< The data blob
  1489. AkUInt32 in_uSizeInBytes ///< Size of data
  1490. );
  1491. //@}
  1492. ////////////////////////////////////////////////////////////////////////
  1493. /// @name Game Objects
  1494. //@{
  1495. /// Registers a game object.
  1496. /// \return
  1497. /// - \c AK_Success if successful
  1498. /// - \c AK_InvalidParameter if the specified AkGameObjectID is invalid (0 and -1 are invalid)
  1499. /// \remark Registering a game object twice does nothing. Unregistering it once unregisters it no
  1500. /// matter how many times it has been registered.
  1501. /// \sa
  1502. /// - <tt>AK::SoundEngine::UnregisterGameObj()</tt>
  1503. /// - <tt>AK::SoundEngine::UnregisterAllGameObj()</tt>
  1504. /// - \ref concept_gameobjects
  1505. AK_EXTERNAPIFUNC(AKRESULT, RegisterGameObj)(
  1506. AkGameObjectID in_gameObjectID ///< ID of the game object to be registered
  1507. );
  1508. /// Registers a game object.
  1509. /// \return
  1510. /// - \c AK_Success if successful
  1511. /// - \c AK_InvalidParameter if the specified AkGameObjectID is invalid (0 and -1 are invalid)
  1512. /// \remark Registering a game object twice does nothing. Unregistering it once unregisters it no
  1513. /// matter how many times it has been registered.
  1514. /// \sa
  1515. /// - <tt>AK::SoundEngine::UnregisterGameObj()</tt>
  1516. /// - <tt>AK::SoundEngine::UnregisterAllGameObj()</tt>
  1517. /// - \ref concept_gameobjects
  1518. AK_EXTERNAPIFUNC( AKRESULT, RegisterGameObj )(
  1519. AkGameObjectID in_gameObjectID, ///< ID of the game object to be registered
  1520. const char * in_pszObjName ///< Name of the game object (for monitoring purpose)
  1521. );
  1522. /// Unregisters a game object.
  1523. /// \return
  1524. /// - \c AK_Success if successful
  1525. /// - \c AK_InvalidParameter if the specified AkGameObjectID is invalid (0 is an invalid ID)
  1526. /// \remark Registering a game object twice does nothing. Unregistering it once unregisters it no
  1527. /// matter how many times it has been registered. Unregistering a game object while it is
  1528. /// in use is allowed, but the control over the parameters of this game object is lost.
  1529. /// For example, say a sound associated with this game object is a 3D moving sound. This sound will
  1530. /// stop moving when the game object is unregistered, and there will be no way to regain control over the game object.
  1531. /// \sa
  1532. /// - <tt>AK::SoundEngine::RegisterGameObj()</tt>
  1533. /// - <tt>AK::SoundEngine::UnregisterAllGameObj()</tt>
  1534. /// - \ref concept_gameobjects
  1535. AK_EXTERNAPIFUNC( AKRESULT, UnregisterGameObj )(
  1536. AkGameObjectID in_gameObjectID ///< ID of the game object to be unregistered. Use
  1537. /// AK_INVALID_GAME_OBJECT to unregister all game objects.
  1538. );
  1539. /// Unregister all game objects, or all game objects with a particular matching set of property flags.
  1540. /// This function to can be used to unregister all game objects.
  1541. /// \return
  1542. /// - \c AK_Success if successful
  1543. /// \remark Registering a game object twice does nothing. Unregistering it once unregisters it no
  1544. /// matter how many times it has been registered. Unregistering a game object while it is
  1545. /// in use is allowed, but the control over the parameters of this game object is lost.
  1546. /// For example, if a sound associated with this game object is a 3D moving sound, it will
  1547. /// stop moving once the game object is unregistered, and there will be no way to recover
  1548. /// the control over this game object.
  1549. /// \sa
  1550. /// - <tt>AK::SoundEngine::RegisterGameObj()</tt>
  1551. /// - <tt>AK::SoundEngine::UnregisterGameObj()</tt>
  1552. /// - \ref concept_gameobjects
  1553. AK_EXTERNAPIFUNC( AKRESULT, UnregisterAllGameObj )(
  1554. );
  1555. /// Sets the position of a game object.
  1556. /// \warning The object's orientation vector (in_Position.Orientation) must be normalized.
  1557. /// \return
  1558. /// - \c AK_Success when successful
  1559. /// - \c AK_InvalidParameter if parameters are not valid, for example:
  1560. /// + in_Position makes an invalid transform
  1561. /// + in_eFlags is not one of the valid enum values
  1562. /// + the game object ID is in the reserved ID range.
  1563. /// \sa
  1564. /// - \ref soundengine_3dpositions
  1565. AK_EXTERNAPIFUNC( AKRESULT, SetPosition )(
  1566. AkGameObjectID in_GameObjectID, ///< Game Object identifier
  1567. const AkSoundPosition & in_Position,///< Position to set; in_Position.Orientation must be normalized.
  1568. AkSetPositionFlags in_eFlags = AkSetPositionFlags_Default ///< Optional flags to independently set the position of the emitter or listener component.
  1569. );
  1570. /// Sets multiple positions to a single game object.
  1571. /// Setting multiple positions on a single game object is a way to simulate multiple emission sources while using the resources of only one voice.
  1572. /// This can be used to simulate wall openings, area sounds, or multiple objects emitting the same sound in the same area.
  1573. /// \aknote Calling <tt>AK::SoundEngine::SetMultiplePositions()</tt> with only one position is the same as calling <tt>AK::SoundEngine::SetPosition()</tt> \endaknote
  1574. /// \return
  1575. /// - \c AK_Success when successful
  1576. /// - \c AK_CommandTooLarge if the number of positions is too large for the command queue. Reduce the number of positions.
  1577. /// - \c AK_InvalidParameter if parameters are not valid, for example:
  1578. /// + in_Position makes an invalid transform
  1579. /// + in_eFlags is not one of the valid enum values
  1580. /// + the game object ID is in the reserved ID range.
  1581. /// \sa
  1582. /// - \ref soundengine_3dpositions
  1583. /// - \ref soundengine_3dpositions_multiplepos
  1584. /// - \ref AK::SoundEngine::MultiPositionType
  1585. AK_EXTERNAPIFUNC( AKRESULT, SetMultiplePositions )(
  1586. AkGameObjectID in_GameObjectID, ///< Game Object identifier.
  1587. const AkSoundPosition * in_pPositions, ///< Array of positions to apply.
  1588. AkUInt16 in_NumPositions, ///< Number of positions specified in the provided array.
  1589. MultiPositionType in_eMultiPositionType = MultiPositionType_MultiDirections, ///< \ref AK::SoundEngine::MultiPositionType
  1590. AkSetPositionFlags in_eFlags = AkSetPositionFlags_Default ///< Optional flags to independently set the position of the emitter or listener component.
  1591. );
  1592. /// Sets multiple positions to a single game object, with flexible assignment of input channels.
  1593. /// Setting multiple positions on a single game object is a way to simulate multiple emission sources while using the resources of only one voice.
  1594. /// This can be used to simulate wall openings, area sounds, or multiple objects emitting the same sound in the same area.
  1595. /// \aknote Calling <tt>AK::SoundEngine::SetMultiplePositions()</tt> with only one position is the same as calling <tt>AK::SoundEngine::SetPosition()</tt> \endaknote
  1596. /// \return
  1597. /// - \c AK_Success when successful
  1598. /// - \c AK_CommandTooLarge if the number of positions is too large for the command queue. Reduce the number of positions.
  1599. /// - \c AK_InvalidParameter if parameters are not valid.
  1600. /// \sa
  1601. /// - \ref soundengine_3dpositions
  1602. /// - \ref soundengine_3dpositions_multiplepos
  1603. /// - \ref AK::SoundEngine::MultiPositionType
  1604. AK_EXTERNAPIFUNC( AKRESULT, SetMultiplePositions )(
  1605. AkGameObjectID in_GameObjectID, ///< Game Object identifier.
  1606. const AkChannelEmitter * in_pPositions, ///< Array of positions to apply, each using its own channel mask.
  1607. AkUInt16 in_NumPositions, ///< Number of positions specified in the provided array.
  1608. MultiPositionType in_eMultiPositionType = MultiPositionType_MultiDirections, ///< \ref AK::SoundEngine::MultiPositionType
  1609. AkSetPositionFlags in_eFlags = AkSetPositionFlags_Default ///< Optional flags to independently set the position of the emitter or listener component.
  1610. );
  1611. /// Sets the scaling factor of a Game Object.
  1612. /// Modify the attenuation computations on this Game Object to simulate sounds with a larger or smaller area of effect.
  1613. /// \return
  1614. /// - \c AK_Success when successful
  1615. /// - \c AK_InvalidParameter if the scaling factor specified was 0 or negative.
  1616. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  1617. AK_EXTERNAPIFUNC( AKRESULT, SetScalingFactor )(
  1618. AkGameObjectID in_GameObjectID, ///< Game object identifier
  1619. AkReal32 in_fAttenuationScalingFactor ///< Scaling Factor, 1 means 100%, 0.5 means 50%, 2 means 200%, and so on.
  1620. );
  1621. /// Use the position of a separate game object for distance calculations for a specified listener.
  1622. /// When <tt>AK::SoundEngine::SetDistanceProbe()</tt> is called, Wwise calculates distance attenuation and filtering
  1623. /// based on the distance between the distance probe Game Object (\c in_distanceProbeGameObjectID) and the emitter Game Object's position.
  1624. /// In third-person perspective applications, the distance probe Game Object may be set to the player character's position,
  1625. /// and the listener Game Object's position to that of the camera. In this scenario, attenuation is based on
  1626. /// the distance between the character and the sound, whereas panning, spatialization, and spread and focus calculations are base on the camera.
  1627. /// Both Game Objects, \c in_listenerGameObjectID and \c in_distanceProbeGameObjectID must have been previously registered using <tt>AK::SoundEngine::RegisterGameObj</tt>.
  1628. /// This funciton is optional. if <tt>AK::SoundEngine::SetDistanceProbe()</tt> is never called, distance calculations are based on the listener Game Object position.
  1629. /// To clear the distance probe, and revert to using the listener position for distance calculations, pass \c AK_INVALID_GAME_OBJECT to \c in_distanceProbeGameObjectID.
  1630. /// \aknote If the distance probe Game Object is assigned multiple positions, then the first position is used for distance calculations by the listener. \endaknote
  1631. /// \return
  1632. /// - \c AK_Success when successful
  1633. /// \sa
  1634. /// - <tt>AK::SoundEngine::SetPosition()</tt>
  1635. AK_EXTERNAPIFUNC(AKRESULT, SetDistanceProbe)(
  1636. AkGameObjectID in_listenerGameObjectID, ///< Game object identifier for the listener. Must have been previously registered via RegisterGameObj.
  1637. AkGameObjectID in_distanceProbeGameObjectID ///< Game object identifier for the distance probe, or \c AK_INVALID_GAME_OBJECT to reset distance probe. If valid, must have been previously registered via RegisterGameObj.
  1638. );
  1639. //@}
  1640. ////////////////////////////////////////////////////////////////////////
  1641. /// @name Bank Management
  1642. //@{
  1643. /// Unload all currently loaded banks.
  1644. /// It also internally calls ClearPreparedEvents() since at least one bank must have been loaded to allow preparing events.
  1645. /// \return
  1646. /// - \c AK_Success if successful
  1647. /// - \c AK_NotInitialized if the sound engine was not correctly initialized or if there is not enough memory to handle the command
  1648. /// \sa
  1649. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1650. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  1651. /// - \ref soundengine_banks
  1652. AK_EXTERNAPIFUNC( AKRESULT, ClearBanks )();
  1653. /// Sets the I/O settings of the bank load and prepare event processes.
  1654. /// The sound engine uses default values unless explicitly set by calling this method.
  1655. /// \warning This function must be called before loading banks.
  1656. /// \return
  1657. /// - \c AK_Success if successful
  1658. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1659. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1660. /// \sa
  1661. /// - \ref soundengine_banks
  1662. /// - \ref streamingdevicemanager
  1663. AK_EXTERNAPIFUNC( AKRESULT, SetBankLoadIOSettings )(
  1664. AkReal32 in_fThroughput, ///< Average throughput of bank data streaming (bytes/ms) (the default value is AK_DEFAULT_BANK_THROUGHPUT)
  1665. AkPriority in_priority ///< Priority of bank streaming (the default value is AK_DEFAULT_PRIORITY)
  1666. );
  1667. #ifdef AK_SUPPORT_WCHAR
  1668. /// Load a bank synchronously (by Unicode string).\n
  1669. /// The bank name and type are passed to the Stream Manager.
  1670. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  1671. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1672. /// The function returns when the request has been completely processed.
  1673. /// \return
  1674. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  1675. /// You may use this ID with UnloadBank().
  1676. /// - \c AK_Success: Load or unload successful.
  1677. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1678. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1679. /// - \c AK_BankReadError: I/O error.
  1680. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that you used to generate the SoundBanks matches that of the SDK you are currently using.
  1681. /// - \c AK_InvalidFile: File specified could not be opened.
  1682. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  1683. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1684. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1685. /// - \c AK_InvalidBankType if the bank type parameter is out of range.
  1686. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure, check the debug console)
  1687. /// \remarks
  1688. /// - The initialization bank must be loaded first.
  1689. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1690. /// initialization bank. If you need to load SoundBanks from a different project, you
  1691. /// must first unload ALL banks, including the initialization bank, then load the
  1692. /// initialization bank from the other project, and finally load banks from that project.
  1693. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1694. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1695. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1696. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1697. /// posting the event will fail.
  1698. /// - The sound engine internally calls GetIDFromString(in_pszString) to return the correct bank ID.
  1699. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  1700. /// not the name of the file (if you changed it), nor the full path of the file. The path should be resolved in
  1701. /// your implementation of the Stream Manager, or in the Low-Level I/O module if you use the default Stream Manager's implementation.
  1702. /// \sa
  1703. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1704. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1705. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  1706. /// - \ref soundengine_banks
  1707. /// - \ref integrating_elements_plugins
  1708. /// - \ref streamingdevicemanager
  1709. /// - \ref streamingmanager_lowlevel
  1710. /// - \ref sdk_bank_training
  1711. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  1712. const wchar_t* in_pszString, ///< Name of the bank to load
  1713. AkBankID & out_bankID, ///< Returned bank ID
  1714. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  1715. );
  1716. #endif //AK_SUPPORT_WCHAR
  1717. /// Loads a bank synchronously.\n
  1718. /// The bank name and type are passed to the Stream Manager.
  1719. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  1720. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1721. /// The function returns when the request has been completely processed.
  1722. /// \return
  1723. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  1724. /// You may use this ID with UnloadBank().
  1725. /// - \c AK_Success: Load or unload successful.
  1726. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1727. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1728. /// - \c AK_BankReadError: I/O error.
  1729. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1730. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1731. /// - \c AK_InvalidFile: File specified could not be opened.
  1732. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1733. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1734. /// - \c AK_InvalidBankType if the bank type parameter is out of range.
  1735. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  1736. /// \remarks
  1737. /// - The initialization bank must be loaded first.
  1738. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1739. /// initialization bank. If you need to load SoundBanks from a different project, you
  1740. /// must first unload ALL banks, including the initialization bank, then load the
  1741. /// initialization bank from the other project, and finally load banks from that project.
  1742. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1743. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1744. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1745. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1746. /// posting the event will fail.
  1747. /// - The sound engine internally calls GetIDFromString(in_pszString) to return the correct bank ID.
  1748. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  1749. /// not the name of the file (if you changed it), nor the full path of the file. The path should be resolved in
  1750. /// your implementation of the Stream Manager, or in the Low-Level I/O module if you use the default Stream Manager's implementation.
  1751. /// \sa
  1752. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1753. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1754. /// - <tt>AK::SoundEngine::GetIDFromString</tt>
  1755. /// - \ref soundengine_banks
  1756. /// - \ref integrating_elements_plugins
  1757. /// - \ref streamingdevicemanager
  1758. /// - \ref streamingmanager_lowlevel
  1759. /// - \ref sdk_bank_training
  1760. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  1761. const char* in_pszString, ///< Name of the bank to load
  1762. AkBankID & out_bankID, ///< Returned bank ID
  1763. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  1764. );
  1765. /// Loads a bank synchronously (by ID).\n
  1766. /// \aknote Requires that the "Use SoundBank names" option be unchecked in the Wwise Project Settings. \endaknote
  1767. /// The bank ID is passed to the Stream Manager.
  1768. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  1769. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1770. /// The function returns when the request has been completely processed.
  1771. /// \return
  1772. /// - \c AK_Success: Load or unload successful.
  1773. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1774. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1775. /// - \c AK_BankReadError: I/O error. The bank is either shorter than expected or its data corrupted.
  1776. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1777. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1778. /// - \c AK_InvalidFile: File specified could not be opened.
  1779. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1780. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console or Wwise Profiler
  1781. /// - \c AK_InvalidBankType if the bank type parameter is out of range.
  1782. /// - \c AK_FileNotFound if the bank file was not found on disk.
  1783. /// - \c AK_FilePermissionError if the file permissions are wrong for the file
  1784. /// - \c AK_Fail: Load or unload failed for any other reason. , check the debug console or Wwise Profiler
  1785. /// \remarks
  1786. /// - The initialization bank must be loaded first.
  1787. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1788. /// initialization bank. If you need to load SoundBanks from a different project, you
  1789. /// must first unload ALL banks, including the initialization bank, then load the
  1790. /// initialization bank from the other project, and finally load banks from that project.
  1791. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1792. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1793. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1794. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1795. /// posting the event will fail.
  1796. /// \sa
  1797. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1798. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1799. /// - \ref soundengine_banks
  1800. /// - \ref integrating_elements_plugins
  1801. /// - \ref sdk_bank_training
  1802. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  1803. AkBankID in_bankID, ///< Bank ID of the bank to load
  1804. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  1805. );
  1806. /// Loads a bank synchronously (from in-memory data, in-place, user bank only).\n
  1807. ///
  1808. /// IMPORTANT: Banks loaded from memory with in-place data MUST be unloaded using the UnloadBank function
  1809. /// providing the same memory pointer. Make sure you are using the correct UnloadBank(...) overload
  1810. ///
  1811. /// Use LoadBankMemoryView when you want to manage I/O on your side. Load the bank file
  1812. /// in a buffer and pass its address to the sound engine.
  1813. /// In-memory loading is in-place: *** the memory must be valid until the bank is unloaded. ***
  1814. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1815. /// The function returns when the request has been completely processed.
  1816. /// \return
  1817. /// The bank ID, which is stored in the first few bytes of the bank file. You may use this
  1818. /// ID with UnloadBank().
  1819. /// - \c AK_Success: Load or unload successful.
  1820. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1821. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1822. /// - \c AK_BankReadError: I/O error.
  1823. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1824. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1825. /// - \c AK_InvalidFile: File specified could not be opened.
  1826. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1827. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1828. /// - \c AK_InvalidBankType if the bank is not a user-defined bank.
  1829. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  1830. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  1831. /// \remarks
  1832. /// - The initialization bank must be loaded first.
  1833. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1834. /// initialization bank. If you need to load SoundBanks from a different project, you
  1835. /// must first unload ALL banks, including the initialization bank, then load the
  1836. /// initialization bank from the other project, and finally load banks from that project.
  1837. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1838. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1839. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1840. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1841. /// posting the event will fail.
  1842. /// - The memory must be aligned on platform-specific AK_BANK_PLATFORM_DATA_ALIGNMENT bytes (see AkTypes.h).
  1843. /// - (XboxOne only): If the bank may contain XMA in memory data, the memory must be allocated using the Device memory allocator.
  1844. /// - Avoid using this function for banks containing a lot of events or structure data: this data will be unpacked into the sound engine heap,
  1845. /// making the supplied bank memory redundant. For event/structure-only banks, prefer LoadBankMemoryCopy().
  1846. /// \sa
  1847. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1848. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1849. /// - \ref soundengine_banks
  1850. /// - \ref integrating_elements_plugins
  1851. /// - \ref sdk_bank_training
  1852. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryView )(
  1853. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is stored in sound engine, memory must remain valid)
  1854. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  1855. AkBankID & out_bankID ///< Returned bank ID
  1856. );
  1857. /// Loads a bank synchronously (from in-memory data, in-place, any bank type).\n
  1858. ///
  1859. /// IMPORTANT: Banks loaded from memory with in-place data MUST be unloaded using the UnloadBank function
  1860. /// providing the same memory pointer. Make sure you are using the correct UnloadBank(...) overload
  1861. ///
  1862. /// Use LoadBankMemoryView when you want to manage I/O on your side. Load the bank file
  1863. /// in a buffer and pass its address to the sound engine.
  1864. /// In-memory loading is in-place: *** the memory must be valid until the bank is unloaded. ***
  1865. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1866. /// The function returns when the request has been completely processed.
  1867. /// \return
  1868. /// The bank ID, which is stored in the first few bytes of the bank file. You may use this
  1869. /// ID with UnloadBank().
  1870. /// - \c AK_Success: Load or unload successful.
  1871. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1872. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1873. /// - \c AK_BankReadError: I/O error.
  1874. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1875. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1876. /// - \c AK_InvalidFile: File specified could not be opened.
  1877. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1878. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1879. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  1880. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  1881. /// \remarks
  1882. /// - The initialization bank must be loaded first.
  1883. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1884. /// initialization bank. If you need to load SoundBanks from a different project, you
  1885. /// must first unload ALL banks, including the initialization bank, then load the
  1886. /// initialization bank from the other project, and finally load banks from that project.
  1887. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1888. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1889. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1890. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1891. /// posting the event will fail.
  1892. /// - The memory must be aligned on platform-specific AK_BANK_PLATFORM_DATA_ALIGNMENT bytes (see AkTypes.h).
  1893. /// - (XboxOne only): If the bank may contain XMA in memory data, the memory must be allocated using the Device memory allocator.
  1894. /// - Avoid using this function for banks containing a lot of events or structure data: this data will be unpacked into the sound engine heap,
  1895. /// making the supplied bank memory redundant. For event/structure-only banks, prefer LoadBankMemoryCopy().
  1896. /// \sa
  1897. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1898. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1899. /// - \ref soundengine_banks
  1900. /// - \ref integrating_elements_plugins
  1901. /// - \ref sdk_bank_training
  1902. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryView )(
  1903. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is stored in sound engine, memory must remain valid)
  1904. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  1905. AkBankID & out_bankID, ///< Returned bank ID
  1906. AkBankType & out_bankType ///< Returned bank type
  1907. );
  1908. /// Loads a bank synchronously (from in-memory data, out-of-place, user bank only).\n
  1909. ///
  1910. /// NOTE: Banks loaded from in-memory with out-of-place data must be unloaded using the standard UnloadBank function
  1911. /// (with no memory pointer). Make sure you are using the correct UnloadBank(...) overload
  1912. ///
  1913. /// Use LoadBankMemoryCopy when you want to manage I/O on your side. Load the bank file
  1914. /// in a buffer and pass its address to the sound engine, the media section of the bank will be copied into newly
  1915. /// allocated memory.
  1916. /// In-memory loading is out-of-place: the buffer can be release as soon as the function returns. The advantage of using this
  1917. /// over the in-place version is that there is no duplication of bank structures.
  1918. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1919. /// The function returns when the request has been completely processed.
  1920. /// \return
  1921. /// The bank ID, which is stored in the first few bytes of the bank file. You may use this
  1922. /// ID with UnloadBank().
  1923. /// - \c AK_Success: Load or unload successful.
  1924. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1925. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1926. /// - \c AK_BankReadError: I/O error.
  1927. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1928. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1929. /// - \c AK_InvalidFile: File specified could not be opened.
  1930. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1931. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1932. /// - \c AK_InvalidBankType if the bank is not a user-defined bank.
  1933. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  1934. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  1935. /// \remarks
  1936. /// - The initialization bank must be loaded first.
  1937. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1938. /// initialization bank. If you need to load SoundBanks from a different project, you
  1939. /// must first unload ALL banks, including the initialization bank, then load the
  1940. /// initialization bank from the other project, and finally load banks from that project.
  1941. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1942. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1943. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1944. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1945. /// posting the event will fail.
  1946. /// \sa
  1947. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1948. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1949. /// - \ref soundengine_banks
  1950. /// - \ref integrating_elements_plugins
  1951. /// - \ref sdk_bank_training
  1952. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryCopy )(
  1953. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is not stored in sound engine, memory can be released after return)
  1954. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  1955. AkBankID & out_bankID ///< Returned bank ID
  1956. );
  1957. /// Loads a bank synchronously (from in-memory data, out-of-place, any bank type).\n
  1958. ///
  1959. /// NOTE: Banks loaded from in-memory with out-of-place data must be unloaded using the standard UnloadBank function
  1960. /// (with no memory pointer). Make sure you are using the correct UnloadBank(...) overload
  1961. ///
  1962. /// Use LoadBankMemoryCopy when you want to manage I/O on your side. Load the bank file
  1963. /// in a buffer and pass its address to the sound engine, the media section of the bank will be copied into newly
  1964. /// allocated memory.
  1965. /// In-memory loading is out-of-place: the buffer can be release as soon as the function returns. The advantage of using this
  1966. /// over the in-place version is that there is no duplication of bank structures.
  1967. /// A bank load request will be posted, and consumed by the Bank Manager thread.
  1968. /// The function returns when the request has been completely processed.
  1969. /// \return
  1970. /// The bank ID, which is stored in the first few bytes of the bank file. You may use this
  1971. /// ID with UnloadBank().
  1972. /// - \c AK_Success: Load or unload successful.
  1973. /// - \c AK_BankAlreadyLoaded: This bank is already loaded, nothing done.
  1974. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  1975. /// - \c AK_BankReadError: I/O error.
  1976. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  1977. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  1978. /// - \c AK_InvalidFile: File specified could not be opened.
  1979. /// - \c AK_NotInitialized if the sound engine was not correctly initialized
  1980. /// - \c AK_InvalidParameter if some parameters are invalid, check the debug console
  1981. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  1982. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  1983. /// \remarks
  1984. /// - The initialization bank must be loaded first.
  1985. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  1986. /// initialization bank. If you need to load SoundBanks from a different project, you
  1987. /// must first unload ALL banks, including the initialization bank, then load the
  1988. /// initialization bank from the other project, and finally load banks from that project.
  1989. /// - Codecs and plug-ins must be registered before loading banks that use them.
  1990. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  1991. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  1992. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  1993. /// posting the event will fail.
  1994. /// \sa
  1995. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  1996. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  1997. /// - \ref soundengine_banks
  1998. /// - \ref integrating_elements_plugins
  1999. /// - \ref sdk_bank_training
  2000. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryCopy )(
  2001. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is not stored in sound engine, memory can be released after return)
  2002. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  2003. AkBankID & out_bankID, ///< Returned bank ID
  2004. AkBankType & out_bankType ///< Returned bank type
  2005. );
  2006. /// Synchronously decodes Vorbis-encoded and Opus-encoded (Software version) media in a SoundBank. The file should already be read in memory before the decode operation. The out_pDecodedBankPtr can then be used with variants of LoadBank that load from in-memory data.
  2007. /// \n
  2008. /// CPU usage, RAM size, storage size and Internet bandwidth must be accounted for when developing a game, especially when it is aimed at mobile platforms. The DecodeBank function makes it possible to decode media at load time instead of decoding them every time they are played.
  2009. AK_EXTERNAPIFUNC( AKRESULT, DecodeBank )(
  2010. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to decode (pointer is not stored in sound engine, memory can be released after return)
  2011. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to decode
  2012. AkMemPoolId in_uPoolForDecodedBank, ///< Memory pool to allocate decoded bank into. Specify AK_INVALID_POOL_ID and out_pDecodedBankPtr=NULL to obtain decoded bank size without performing the decode operation. Pass AK_INVALID_POOL_ID and out_pDecodedBankPtr!=NULL to decode bank into specified pointer.
  2013. void * & out_pDecodedBankPtr, ///< Decoded bank memory location.
  2014. AkUInt32 & out_uDecodedBankSize ///< Decoded bank memory size.
  2015. );
  2016. #ifdef AK_SUPPORT_WCHAR
  2017. /// Loads a bank asynchronously (by Unicode string).\n
  2018. /// The bank name is passed to the Stream Manager.
  2019. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2020. /// A bank load request will be posted to the Bank Manager consumer thread.
  2021. /// The function returns immediately.
  2022. /// \return
  2023. /// AK_Success if the scheduling was successful, AK_Fail otherwise.
  2024. /// Use a callback to be notified when completed, and get the status of the request.
  2025. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2026. /// You may use this ID with UnloadBank().
  2027. /// \remarks
  2028. /// - The initialization bank must be loaded first.
  2029. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2030. /// initialization bank. If you need to load SoundBanks from a different project, you
  2031. /// must first unload ALL banks, including the initialization bank, then load the
  2032. /// initialization bank from the other project, and finally load banks from that project.
  2033. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2034. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2035. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2036. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2037. /// posting the event will fail.
  2038. /// - The sound engine internally calls GetIDFromString(in_pszString) to return the correct bank ID.
  2039. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2040. /// not the name of the file (if you changed it), nor the full path of the file. The path should be resolved in
  2041. /// your implementation of the Stream Manager (<tt>AK::IAkStreamMgr::CreateStd()</tt>), or in the Low-Level I/O module
  2042. /// (<tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>) if you use the default Stream Manager's implementation.
  2043. /// - The cookie (in_pCookie) is passed to the Low-Level I/O module for your convenience, in <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>
  2044. // as AkFileSystemFlags::pCustomParam.
  2045. /// \sa
  2046. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2047. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2048. /// - AkBankCallbackFunc
  2049. /// - \ref soundengine_banks
  2050. /// - \ref integrating_elements_plugins
  2051. /// - \ref streamingdevicemanager
  2052. /// - \ref streamingmanager_lowlevel
  2053. /// - \ref sdk_bank_training
  2054. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  2055. const wchar_t* in_pszString, ///< Name/path of the bank to load
  2056. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2057. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function, and also to <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> as AkFileSystemFlags::pCustomParam)
  2058. AkBankID & out_bankID, ///< Returned bank ID
  2059. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  2060. );
  2061. #endif //AK_SUPPORT_WCHAR
  2062. /// Loads a bank asynchronously.\n
  2063. /// The bank name is passed to the Stream Manager.
  2064. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2065. /// A bank load request will be posted to the Bank Manager consumer thread.
  2066. /// The function returns immediately.
  2067. /// \return
  2068. /// - \c AK_Success if the scheduling was successful,
  2069. /// - \c AK_InvalidBankType if in_bankType was invalid
  2070. /// Use a callback to be notified when completed, and get the status of the request.
  2071. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2072. /// You may use this ID with UnloadBank().
  2073. /// \remarks
  2074. /// - The initialization bank must be loaded first.
  2075. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2076. /// initialization bank. If you need to load SoundBanks from a different project, you
  2077. /// must first unload ALL banks, including the initialization bank, then load the
  2078. /// initialization bank from the other project, and finally load banks from that project.
  2079. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2080. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2081. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2082. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2083. /// posting the Event will fail.
  2084. /// - The sound engine internally calls GetIDFromString(in_pszString) to return the correct bank ID.
  2085. /// Therefore, \c in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2086. /// not the name of the file (if you changed it), nor the full path of the file. The path should be resolved in
  2087. /// your implementation of the Stream Manager (<tt>AK::IAkStreamMgr::CreateStd()</tt>), or in the Low-Level I/O module
  2088. /// (<tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>) if you use the default Stream Manager's implementation.
  2089. /// - The cookie (in_pCookie) is passed to the Low-Level I/O module for your convenience, in <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>
  2090. // as <tt>AkFileSystemFlags::pCustomParam</tt>.
  2091. /// \sa
  2092. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2093. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2094. /// - AkBankCallbackFunc
  2095. /// - \ref soundengine_banks
  2096. /// - \ref integrating_elements_plugins
  2097. /// - \ref streamingdevicemanager
  2098. /// - \ref streamingmanager_lowlevel
  2099. /// - \ref sdk_bank_training
  2100. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  2101. const char* in_pszString, ///< Name/path of the bank to load
  2102. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2103. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function, and also to <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> as AkFileSystemFlags::pCustomParam)
  2104. AkBankID & out_bankID, ///< Returned bank ID
  2105. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  2106. );
  2107. /// Loads a bank asynchronously (by ID).\n
  2108. /// \aknote Requires that the "Use SoundBank names" option be unchecked in the Wwise Project Settings. \endaknote
  2109. /// The bank ID is passed to the Stream Manager.
  2110. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2111. /// A bank load request will be posted to the Bank Manager consumer thread.
  2112. /// The function returns immediately.
  2113. /// \return
  2114. /// - \c AK_Success if the scheduling was successful,
  2115. /// - \c AK_InvalidBankType if in_bankType was invalid
  2116. /// Use a callback to be notified when completed, and get the status of the request.
  2117. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2118. /// You may use this ID with \c UnloadBank().
  2119. /// \remarks
  2120. /// - The initialization bank must be loaded first.
  2121. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2122. /// initialization bank. If you need to load SoundBanks from a different project, you
  2123. /// must first unload ALL banks, including the initialization bank, then load the
  2124. /// initialization bank from the other project, and finally load banks from that project.
  2125. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2126. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2127. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2128. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2129. /// posting the event will fail.
  2130. /// - The file path should be resolved in your implementation of the Stream Manager, or in the Low-Level I/O module if
  2131. /// you use the default Stream Manager's implementation. The ID overload of <tt>AK::IAkStreamMgr::CreateStd()</tt> and <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> are called.
  2132. /// - The cookie (in_pCookie) is passed to the Low-Level I/O module for your convenience, in <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>
  2133. // as AkFileSystemFlags::pCustomParam.
  2134. /// \sa
  2135. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2136. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2137. /// - AkBankCallbackFunc
  2138. /// - \ref soundengine_banks
  2139. /// - \ref integrating_elements_plugins
  2140. /// - \ref sdk_bank_training
  2141. AK_EXTERNAPIFUNC( AKRESULT, LoadBank )(
  2142. AkBankID in_bankID, ///< Bank ID of the bank to load
  2143. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2144. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function, and also to <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt> as AkFileSystemFlags::pCustomParam)
  2145. AkBankType in_bankType = AkBankType_User ///< Type of the bank to load
  2146. );
  2147. /// Loads a bank asynchronously (from in-memory data, in-place, user bank only).\n
  2148. ///
  2149. /// IMPORTANT: Banks loaded from memory with in-place data MUST be unloaded using the UnloadBank function
  2150. /// providing the same memory pointer. Make sure you are using the correct UnloadBank(...) overload
  2151. ///
  2152. /// Use LoadBankMemoryView when you want to manage I/O on your side. Load the bank file
  2153. /// in a buffer and pass its address to the sound engine.
  2154. /// In-memory loading is in-place: *** the memory must be valid until the bank is unloaded. ***
  2155. /// A bank load request will be posted to the Bank Manager consumer thread.
  2156. /// The function returns immediately.
  2157. /// \return
  2158. /// - \c AK_Success if the scheduling was successful,
  2159. /// - \c AK_InvalidBankType if the bank is not a user-defined bank.
  2160. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  2161. /// Use a callback to be notified when completed, and get the status of the request.
  2162. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2163. /// You may use this ID with UnloadBank().
  2164. /// \remarks
  2165. /// - The initialization bank must be loaded first.
  2166. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2167. /// initialization bank. If you need to load SoundBanks from a different project, you
  2168. /// must first unload ALL banks, including the initialization bank, then load the
  2169. /// initialization bank from the other project, and finally load banks from that project.
  2170. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2171. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2172. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2173. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2174. /// posting the event will fail.
  2175. /// - The memory must be aligned on platform-specific AK_BANK_PLATFORM_DATA_ALIGNMENT bytes (see AkTypes.h).
  2176. /// - (XboxOne only): If the bank may contain XMA in memory data, the memory must be allocated using the Device memory allocator.
  2177. /// - Avoid using this function for banks containing a lot of events or structure data: this data will be unpacked into the sound engine heap,
  2178. /// making the supplied bank memory redundant. For event/structure-only banks, prefer LoadBankMemoryCopy().
  2179. /// \sa
  2180. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2181. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2182. /// - AkBankCallbackFunc
  2183. /// - \ref soundengine_banks
  2184. /// - \ref integrating_elements_plugins
  2185. /// - \ref sdk_bank_training
  2186. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryView )(
  2187. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is stored in sound engine, memory must remain valid)
  2188. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  2189. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2190. void * in_pCookie, ///< Callback cookie
  2191. AkBankID & out_bankID ///< Returned bank ID
  2192. );
  2193. /// Loads a bank asynchronously (from in-memory data, in-place, any bank type).\n
  2194. ///
  2195. /// IMPORTANT: Banks loaded from memory with in-place data MUST be unloaded using the UnloadBank function
  2196. /// providing the same memory pointer. Make sure you are using the correct UnloadBank(...) overload
  2197. ///
  2198. /// Use LoadBankMemoryView when you want to manage I/O on your side. Load the bank file
  2199. /// in a buffer and pass its address to the sound engine.
  2200. /// In-memory loading is in-place: *** the memory must be valid until the bank is unloaded. ***
  2201. /// A bank load request will be posted to the Bank Manager consumer thread.
  2202. /// The function returns immediately.
  2203. /// \return
  2204. /// - \c AK_Success if the scheduling was successful,
  2205. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  2206. /// Use a callback to be notified when completed, and get the status of the request.
  2207. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2208. /// You may use this ID with UnloadBank().
  2209. /// \remarks
  2210. /// - The initialization bank must be loaded first.
  2211. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2212. /// initialization bank. If you need to load SoundBanks from a different project, you
  2213. /// must first unload ALL banks, including the initialization bank, then load the
  2214. /// initialization bank from the other project, and finally load banks from that project.
  2215. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2216. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2217. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2218. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2219. /// posting the event will fail.
  2220. /// - The memory must be aligned on platform-specific AK_BANK_PLATFORM_DATA_ALIGNMENT bytes (see AkTypes.h).
  2221. /// - (XboxOne only): If the bank may contain XMA in memory data, the memory must be allocated using the Device memory allocator.
  2222. /// - Avoid using this function for banks containing a lot of events or structure data: this data will be unpacked into the sound engine heap,
  2223. /// making the supplied bank memory redundant. For event/structure-only banks, prefer LoadBankMemoryCopy().
  2224. /// \sa
  2225. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2226. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2227. /// - AkBankCallbackFunc
  2228. /// - \ref soundengine_banks
  2229. /// - \ref integrating_elements_plugins
  2230. /// - \ref sdk_bank_training
  2231. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryView )(
  2232. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is stored in sound engine, memory must remain valid)
  2233. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  2234. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2235. void * in_pCookie, ///< Callback cookie
  2236. AkBankID & out_bankID, ///< Returned bank ID
  2237. AkBankType & out_bankType ///< Returned bank type
  2238. );
  2239. /// Loads a bank asynchronously (from in-memory data, out-of-place, user bank only).\n
  2240. ///
  2241. /// NOTE: Banks loaded from in-memory with out-of-place data must be unloaded using the standard UnloadBank function
  2242. /// (with no memory pointer). Make sure you are using the correct UnloadBank(...) overload
  2243. ///
  2244. /// Use LoadBankMemoryCopy when you want to manage I/O on your side. Load the bank file
  2245. /// in a buffer and pass its address to the sound engine, the media section of the bank will be copied into newly allocated
  2246. /// memory.
  2247. /// In-memory loading is out-of-place: the buffer can be released after the callback function is called. The advantage of using this
  2248. /// over the in-place version is that there is no duplication of bank structures.
  2249. /// A bank load request will be posted to the Bank Manager consumer thread.
  2250. /// The function returns immediately.
  2251. /// \return
  2252. /// - \c AK_Success if the scheduling was successful,
  2253. /// - \c AK_InvalidBankType if the bank is not a user-defined bank.
  2254. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  2255. /// Use a callback to be notified when completed, and get the status of the request.
  2256. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2257. /// You may use this ID with UnloadBank().
  2258. /// \remarks
  2259. /// - The initialization bank must be loaded first.
  2260. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2261. /// initialization bank. If you need to load SoundBanks from a different project, you
  2262. /// must first unload ALL banks, including the initialization bank, then load the
  2263. /// initialization bank from the other project, and finally load banks from that project.
  2264. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2265. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2266. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2267. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2268. /// posting the event will fail.
  2269. /// \sa
  2270. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2271. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2272. /// - AkBankCallbackFunc
  2273. /// - \ref soundengine_banks
  2274. /// - \ref integrating_elements_plugins
  2275. /// - \ref sdk_bank_training
  2276. AK_EXTERNAPIFUNC(AKRESULT, LoadBankMemoryCopy)(
  2277. const void* in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is not stored in sound engine, memory can be released after callback)
  2278. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  2279. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2280. void* in_pCookie, ///< Callback cookie
  2281. AkBankID& out_bankID, ///< Returned bank ID
  2282. AkBankType& out_bankType ///< Returned bank type
  2283. );
  2284. /// Loads a bank asynchronously (from in-memory data, out-of-place, any bank type).\n
  2285. ///
  2286. /// NOTE: Banks loaded from in-memory with out-of-place data must be unloaded using the standard UnloadBank function
  2287. /// (with no memory pointer). Make sure you are using the correct UnloadBank(...) overload
  2288. ///
  2289. /// Use LoadBankMemoryCopy when you want to manage I/O on your side. Load the bank file
  2290. /// in a buffer and pass its address to the sound engine, the media section of the bank will be copied into newly allocated
  2291. /// memory.
  2292. /// In-memory loading is out-of-place: the buffer can be released after the callback function is called. The advantage of using this
  2293. /// over the in-place version is that there is no duplication of bank structures.
  2294. /// A bank load request will be posted to the Bank Manager consumer thread.
  2295. /// The function returns immediately.
  2296. /// \return
  2297. /// - \c AK_Success if the scheduling was successful,
  2298. /// - \c AK_InvalidBankType if in_bankType was invalid
  2299. /// - \c AK_DataAlignmentError if the data pointer is not aligned properly
  2300. /// Use a callback to be notified when completed, and get the status of the request.
  2301. /// The bank ID, which is obtained by hashing the bank name (see GetIDFromString()).
  2302. /// You may use this ID with UnloadBank().
  2303. /// \remarks
  2304. /// - The initialization bank must be loaded first.
  2305. /// - All SoundBanks subsequently loaded must come from the same Wwise project as the
  2306. /// initialization bank. If you need to load SoundBanks from a different project, you
  2307. /// must first unload ALL banks, including the initialization bank, then load the
  2308. /// initialization bank from the other project, and finally load banks from that project.
  2309. /// - Codecs and plug-ins must be registered before loading banks that use them.
  2310. /// - Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
  2311. /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
  2312. /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
  2313. /// posting the event will fail.
  2314. /// \sa
  2315. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2316. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2317. /// - AkBankCallbackFunc
  2318. /// - \ref soundengine_banks
  2319. /// - \ref integrating_elements_plugins
  2320. /// - \ref sdk_bank_training
  2321. AK_EXTERNAPIFUNC( AKRESULT, LoadBankMemoryCopy )(
  2322. const void * in_pInMemoryBankPtr, ///< Pointer to the in-memory bank to load (pointer is not stored in sound engine, memory can be released after callback)
  2323. AkUInt32 in_uInMemoryBankSize, ///< Size of the in-memory bank to load
  2324. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2325. void * in_pCookie, ///< Callback cookie
  2326. AkBankID & out_bankID, ///< Returned bank ID
  2327. AkBankType & out_bankType ///< Returned bank type
  2328. );
  2329. #ifdef AK_SUPPORT_WCHAR
  2330. /// Unloads a bank synchronously (by Unicode string).\n
  2331. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2332. /// \return AK_Success if successful, AK_Fail otherwise. AK_Success is returned when the bank was not loaded.
  2333. /// \remarks
  2334. /// - The sound engine internally calls GetIDFromString(in_pszString) to retrieve the bank ID,
  2335. /// then it calls the synchronous version of UnloadBank() by ID.
  2336. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2337. /// not the name of the file (if you changed it), nor the full path of the file.
  2338. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2339. /// This means that streamed sounds or generated sounds will not be stopped.
  2340. /// \sa
  2341. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2342. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2343. /// - \ref soundengine_banks
  2344. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2345. const wchar_t* in_pszString, ///< Name of the bank to unload
  2346. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2347. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2348. );
  2349. #endif //AK_SUPPORT_WCHAR
  2350. /// Unloads a bank synchronously.\n
  2351. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2352. /// \return AK_Success if successful, AK_Fail otherwise. AK_Success is returned when the bank was not loaded.
  2353. /// \remarks
  2354. /// - The sound engine internally calls GetIDFromString(in_pszString) to retrieve the bank ID,
  2355. /// then it calls the synchronous version of UnloadBank() by ID.
  2356. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2357. /// not the name of the file (if you changed it), nor the full path of the file.
  2358. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2359. /// This means that streamed sounds or generated sounds will not be stopped.
  2360. /// \sa
  2361. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2362. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2363. /// - \ref soundengine_banks
  2364. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2365. const char* in_pszString, ///< Name of the bank to unload
  2366. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2367. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2368. );
  2369. /// Unloads a bank synchronously (by ID and memory pointer).\n
  2370. /// \return AK_Success if successful, AK_Fail otherwise. AK_Success is returned when the bank was not loaded.
  2371. /// \remarks
  2372. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2373. /// This means that streamed sounds or generated sounds will not be stopped.
  2374. /// \sa
  2375. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2376. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2377. /// - \ref soundengine_banks
  2378. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2379. AkBankID in_bankID, ///< ID of the bank to unload
  2380. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2381. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2382. );
  2383. #ifdef AK_SUPPORT_WCHAR
  2384. /// Unloads a bank asynchronously (by Unicode string).\n
  2385. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2386. /// \return AK_Success if scheduling successful (use a callback to be notified when completed)
  2387. /// \remarks
  2388. /// The sound engine internally calls GetIDFromString(in_pszString) to retrieve the bank ID,
  2389. /// then it calls the synchronous version of UnloadBank() by ID.
  2390. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2391. /// not the name of the file (if you changed it), nor the full path of the file.
  2392. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2393. /// This means that streamed sounds or generated sounds will not be stopped.
  2394. /// \sa
  2395. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2396. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2397. /// - AkBankCallbackFunc
  2398. /// - \ref soundengine_banks
  2399. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2400. const wchar_t* in_pszString, ///< Name of the bank to unload
  2401. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2402. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2403. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2404. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2405. );
  2406. #endif //AK_SUPPORT_WCHAR
  2407. /// Unloads a bank asynchronously.\n
  2408. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2409. /// \return AK_Success if scheduling successful (use a callback to be notified when completed)
  2410. /// \remarks
  2411. /// The sound engine internally calls GetIDFromString(in_pszString) to retrieve the bank ID,
  2412. /// then it calls the synchronous version of UnloadBank() by ID.
  2413. /// Therefore, in_pszString should be the real name of the SoundBank (with or without the BNK extension - it is trimmed internally),
  2414. /// not the name of the file (if you changed it), nor the full path of the file.
  2415. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2416. /// This means that streamed sounds or generated sounds will not be stopped.
  2417. /// \sa
  2418. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2419. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2420. /// - AkBankCallbackFunc
  2421. /// - \ref soundengine_banks
  2422. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2423. const char* in_pszString, ///< Name of the bank to unload
  2424. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2425. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2426. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2427. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2428. );
  2429. /// Unloads a bank asynchronously (by ID and memory pointer).\n
  2430. /// Refer to \ref soundengine_banks_general for a discussion on using strings and IDs.
  2431. /// \return AK_Success if scheduling successful (use a callback to be notified when completed)
  2432. /// \remarks
  2433. /// - In order to force the memory deallocation of the bank, sounds that use media from this bank will be stopped.
  2434. /// This means that streamed sounds or generated sounds will not be stopped.
  2435. /// \sa
  2436. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2437. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2438. /// - AkBankCallbackFunc
  2439. /// - \ref soundengine_banks
  2440. AK_EXTERNAPIFUNC( AKRESULT, UnloadBank )(
  2441. AkBankID in_bankID, ///< ID of the bank to unload
  2442. const void * in_pInMemoryBankPtr, ///< Memory pointer from where the bank was initially loaded from. (REQUIRED to determine which bank associated to a memory pointer must be unloaded). Pass NULL if NULL was passed when loading the bank or if LoadBankMemoryCopy was used to load the bank.
  2443. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2444. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2445. AkBankType in_bankType = AkBankType_User ///< Type of the bank to unload
  2446. );
  2447. /// Cancels all Event callbacks associated with a specific callback cookie specified while loading Banks of preparing Events.\n
  2448. /// \sa
  2449. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2450. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2451. /// - <tt>AK::SoundEngine::UnloadBank()</tt>
  2452. /// - <tt>AK::SoundEngine::ClearBanks()</tt>
  2453. /// - AkBankCallbackFunc
  2454. AK_EXTERNAPIFUNC( void, CancelBankCallbackCookie )(
  2455. void * in_pCookie ///< Callback cookie to be canceled
  2456. );
  2457. /// Preparation type.
  2458. /// \sa
  2459. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2460. /// - <tt>AK::SoundEngine::PrepareGameSyncs()</tt>
  2461. /// - <tt>AK::SoundEngine::PrepareBank()</tt>
  2462. enum PreparationType
  2463. {
  2464. Preparation_Load, ///< \c PrepareEvent() will load required information to play the specified event.
  2465. Preparation_Unload, ///< \c PrepareEvent() will unload required information to play the specified event.
  2466. Preparation_LoadAndDecode ///< Vorbis media is decoded when loading, and an uncompressed PCM version is used for playback.
  2467. };
  2468. /// Parameter to be passed to <tt>AK::SoundEngine::PrepareBank()</tt>.
  2469. /// Use AkBankContent_All to load both the media and structural content from the bank.
  2470. /// Use AkBankContent_StructureOnly to load only the structural content, including events, from the bank and then later use the PrepareEvent() functions to load media on demand from loose files on the disk.
  2471. /// \sa
  2472. /// - <tt>AK::SoundEngine::PrepareBank()</tt>
  2473. /// - \ref soundengine_banks_preparingbanks
  2474. enum AkBankContent
  2475. {
  2476. AkBankContent_StructureOnly, ///< Use AkBankContent_StructureOnly to load only the structural content, including Events, and then later use the PrepareEvent() functions to load media on demand from loose files on the disk.
  2477. AkBankContent_All ///< Use AkBankContent_All to load both the media and structural content.
  2478. };
  2479. #ifdef AK_SUPPORT_WCHAR
  2480. /// This function will load the Events, structural content, and optionally, the media content from the SoundBank. If the flag AkBankContent_All is specified, PrepareBank() will load the media content from
  2481. /// the bank; but, as opposed to LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using PrepareBank(), alone or in combination with PrepareEvent(),
  2482. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2483. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2484. /// allowing using PrepareEvent() to load media on demand.
  2485. /// \sa
  2486. /// - \ref soundengine_banks_preparingbanks
  2487. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2488. /// - <tt>AK::SoundEngine::PreparationType</tt>
  2489. /// \remarks
  2490. /// PrepareBank(), when called with the flag AkBankContent_StructureOnly, requires additional calls to PrepareEvent() to load the media for each event. PrepareEvent(), however, is unable to
  2491. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2492. /// for example, a game may have a tool mode that uses PrepareEvent() to load loose files on-demand and, also, a game mode that uses LoadBank() to load the bank in entirety.
  2493. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2494. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2495. const wchar_t* in_pszString, ///< Name of the bank to Prepare/Unprepare.
  2496. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2497. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2498. );
  2499. #endif //AK_SUPPORT_WCHAR
  2500. /// This function will load the Events, structural content, and optionally, the media content from the SoundBank. If the flag AkBankContent_All is specified, PrepareBank() will load the media content from
  2501. /// the bank; but, as opposed to LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using PrepareBank(), alone or in combination with PrepareEvent(),
  2502. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2503. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2504. /// allowing using PrepareEvent() to load media on demand.
  2505. /// \sa
  2506. /// - \ref soundengine_banks_preparingbanks
  2507. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2508. /// - <tt>AK::SoundEngine::PreparationType</tt>
  2509. /// \remarks
  2510. /// \c PrepareBank(), when called with the flag \c AkBankContent_StructureOnly, requires additional calls to \c PrepareEvent() to load the media for each event. \c PrepareEvent(), however, is unable to
  2511. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2512. /// for example, a game may have a tool mode that uses PrepareEvent() to load loose files on-demand and, also, a game mode that uses \c LoadBank() to load the bank in entirety.
  2513. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2514. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2515. const char* in_pszString, ///< Name of the bank to Prepare/Unprepare.
  2516. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2517. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2518. );
  2519. /// \n\aknote Requires that the "Use SoundBank names" option be unchecked in the Wwise Project Settings. \endaknote
  2520. /// This function will load the events, structural content, and optionally, the media content from the SoundBank. If the flag AkBankContent_All is specified, PrepareBank() will load the media content from
  2521. /// the bank, but as opposed to LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using PrepareBank(), alone or in combination with PrepareEvent(),
  2522. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2523. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2524. /// allowing using PrepareEvent() to load media on demand.
  2525. /// \sa
  2526. /// - \ref soundengine_banks_preparingbanks
  2527. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2528. /// - <tt>AK::SoundEngine::PreparationType</tt>
  2529. /// \remarks
  2530. /// \c PrepareBank(), when called with the flag AkBankContent_StructureOnly, requires additional calls to PrepareEvent() to load the media for each event. PrepareEvent(), however, is unable to
  2531. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2532. /// for example, a game may have a tool mode that uses PrepareEvent() to load loose files on-demand and, also, a game mode that uses LoadBank() to load the bank in entirety.
  2533. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2534. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2535. AkBankID in_bankID, ///< ID of the bank to Prepare/Unprepare.
  2536. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2537. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2538. );
  2539. #ifdef AK_SUPPORT_WCHAR
  2540. /// This function will load the Events, structural content, and optionally, the media content from the SoundBank. If the flag AkBankContent_All is specified, PrepareBank() will load the media content from
  2541. /// the bank, but as opposed to LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using PrepareBank(), alone or in combination with PrepareEvent(),
  2542. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2543. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2544. /// allowing using PrepareEvent() to load media on demand.
  2545. /// \sa
  2546. /// - \ref soundengine_banks_preparingbanks
  2547. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2548. /// - <tt>AK::SoundEngine::PreparationType</tt>
  2549. /// \remarks
  2550. /// PrepareBank(), when called with the flag AkBankContent_StructureOnly, requires additional calls to PrepareEvent() to load the media for each event. PrepareEvent(), however, is unable to
  2551. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2552. /// for example, a game may have a tool mode that uses PrepareEvent() to load loose files on-demand and, also, a game mode that uses LoadBank() to load the bank in entirety.
  2553. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2554. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2555. const wchar_t* in_pszString, ///< Name of the bank to Prepare/Unprepare.
  2556. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2557. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2558. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2559. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2560. );
  2561. #endif //AK_SUPPORT_WCHAR
  2562. /// This function will load the events, structural content, and optionally, the media content from the SoundBank. If the flag \c AkBankContent_All is specified, \c PrepareBank() will load the media content from
  2563. /// the bank, but as opposed to \c LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using \c PrepareBank(), alone or in combination with PrepareEvent(),
  2564. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2565. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2566. /// allowing using PrepareEvent() to load media on demand.
  2567. /// \sa
  2568. /// - \ref soundengine_banks_preparingbanks
  2569. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2570. /// - <tt>AK::SoundEngine::PreparationType()</tt>
  2571. /// \remarks
  2572. /// PrepareBank(), when called with the flag AkBankContent_StructureOnly, requires additional calls to PrepareEvent() to load the media for each event. PrepareEvent(), however, is unable to
  2573. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2574. /// for example, a game may have a tool mode that uses PrepareEvent() to load loose files on-demand and, also, a game mode that uses LoadBank() to load the bank in entirety.
  2575. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2576. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2577. const char* in_pszString, ///< Name of the bank to Prepare/Unprepare.
  2578. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2579. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2580. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2581. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2582. );
  2583. /// \n\aknote Requires that the "Use SoundBank names" option be unchecked in the Wwise Project Settings. \endaknote
  2584. /// This function will load the events, structural content, and optionally, the media content from the SoundBank. If the flag AkBankContent_All is specified, \c PrepareBank() will load the media content from
  2585. /// the bank, but as opposed to \c LoadBank(), the media will be loaded one media item at a time instead of in one contiguous memory block. Using \c PrepareBank(), alone or in combination with \c PrepareEvent(),
  2586. /// will prevent in-memory duplication of media at the cost of some memory fragmentation.
  2587. /// Calling this function specifying the flag AkBankContent_StructureOnly will load only the structural part (including events) of this bank,
  2588. /// allowing using PrepareEvent() to load media on demand.
  2589. /// \sa
  2590. /// - \ref soundengine_banks_preparingbanks
  2591. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2592. /// - <tt>AK::SoundEngine::PreparationType()</tt>
  2593. /// \remarks
  2594. /// \c PrepareBank(), when called with the flag AkBankContent_StructureOnly, requires additional calls to PrepareEvent() to load the media for each event. \c PrepareEvent(), however, is unable to
  2595. /// access media content contained within SoundBanks and requires that the media be available as loose files in the file system. This flag may be useful to implement multiple loading configurations;
  2596. /// for example, a game may have a tool mode that uses \c PrepareEvent() to load loose files on-demand and, also, a game mode that uses \c LoadBank() to load the bank in entirety.
  2597. AK_EXTERNAPIFUNC( AKRESULT, PrepareBank )(
  2598. AK::SoundEngine::PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2599. AkBankID in_bankID, ///< ID of the bank to Prepare/Unprepare.
  2600. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2601. void * in_pCookie, ///< Callback cookie (reserved to user, passed to the callback function)
  2602. AK::SoundEngine::AkBankContent in_uFlags = AkBankContent_All, ///< Structures only (including events) or all content.
  2603. AkBankType in_bankType = AkBankType_User ///< Type of the bank to Prepare/Unprepare.
  2604. );
  2605. /// Clear all previously prepared events.\n
  2606. /// \return
  2607. /// - \c AK_Success if successful.
  2608. /// - \c AK_Fail if the sound engine was not correctly initialized or if there is not enough memory to handle the command.
  2609. /// \remarks
  2610. /// The function \c ClearBanks() also clears all prepared events.
  2611. /// \sa
  2612. /// - \c <tt>AK::SoundEngine::PrepareEvent()</tt>
  2613. /// - \c <tt>AK::SoundEngine::ClearBanks()</tt>
  2614. AK_EXTERNAPIFUNC( AKRESULT, ClearPreparedEvents )();
  2615. #ifdef AK_SUPPORT_WCHAR
  2616. /// Prepares or unprepares Events synchronously (by Unicode string).\n
  2617. /// The Events are identified by strings, and converted to IDs internally
  2618. /// (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2619. /// Before invoking \c PrepareEvent(), use \c LoadBank() to explicitly load the SoundBank(s)
  2620. /// that contain the Events and structures. When a request is posted to the
  2621. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2622. /// successfully post the specified Events and load the required loose media files.
  2623. /// \aknote Before version 2015.1, the required media files could be included
  2624. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2625. /// however,\c PrepareEvent() now only looks for loose media files.
  2626. /// \endaknote
  2627. /// The function returns when the request is completely processed.
  2628. /// \return
  2629. /// - \c AK_Success: Prepare/un-prepare successful.
  2630. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareEvent() does not exist.
  2631. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2632. /// - \c AK_BankReadError: I/O error.
  2633. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2634. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2635. /// - \c AK_InvalidFile: File specified could not be opened.
  2636. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2637. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2638. /// \remarks
  2639. /// Whenever at least one event fails to be resolved, the actions performed for all
  2640. /// other events are cancelled.
  2641. /// \sa
  2642. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2643. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2644. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2645. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2646. /// - \ref soundengine_banks
  2647. /// - \ref sdk_bank_training
  2648. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2649. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2650. const wchar_t** in_ppszString, ///< Array of event names
  2651. AkUInt32 in_uNumEvent ///< Number of events in the array
  2652. );
  2653. #endif //AK_SUPPORT_WCHAR
  2654. /// Prepares or unprepares events synchronously.\n
  2655. /// The Events are identified by strings and converted to IDs internally
  2656. /// (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2657. /// Before invoking PrepareEvent(), use LoadBank() to explicitly load the SoundBank(s)
  2658. /// that contain the Events and structures. When a request is posted to the
  2659. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2660. /// successfully post the specified Events and load the required loose media files.
  2661. /// \aknote Before version 2015.1, the required media files could be included
  2662. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2663. /// however, PrepareEvent() now only looks for loose media files.
  2664. /// \endaknote
  2665. /// The function returns when the request is completely processed.
  2666. /// \return
  2667. /// - \c AK_Success: Prepare/un-prepare successful.
  2668. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareEvent() does not exist.
  2669. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2670. /// - \c AK_BankReadError: I/O error.
  2671. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2672. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2673. /// - \c AK_InvalidFile: File specified could not be opened.
  2674. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2675. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2676. /// \remarks
  2677. /// Whenever at least one event fails to be resolved, the actions performed for all
  2678. /// other events are cancelled.
  2679. /// \aknote The use of PrepareEvent is incompatible with LoadBank, using in-memory data.
  2680. /// \endaknote
  2681. /// \sa
  2682. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2683. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2684. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2685. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2686. /// - \ref soundengine_banks
  2687. /// - \ref sdk_bank_training
  2688. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2689. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2690. const char** in_ppszString, ///< Array of event names
  2691. AkUInt32 in_uNumEvent ///< Number of events in the array
  2692. );
  2693. /// Prepares or unprepares events synchronously (by ID).
  2694. /// The Events are identified by their ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2695. /// Before invoking PrepareEvent(), use LoadBank() to explicitly load the SoundBank(s)
  2696. /// that contain the Events and structures. When a request is posted to the
  2697. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2698. /// successfully post the specified Events and load the required loose media files.
  2699. /// \aknote Before version 2015.1, the required media files could be included
  2700. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2701. /// however, PrepareEvent() now only looks for loose media files.
  2702. /// \endaknote
  2703. /// The function returns when the request is completely processed.
  2704. /// \return
  2705. /// - \c AK_Success: Prepare/un-prepare successful.
  2706. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareEvent() does not exist.
  2707. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2708. /// - \c AK_BankReadError: I/O error.
  2709. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2710. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2711. /// - \c AK_InvalidFile: File specified could not be opened.
  2712. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2713. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2714. /// \remarks
  2715. /// Whenever at least one event fails to be resolved, the actions performed for all
  2716. /// other events are cancelled.
  2717. /// \sa
  2718. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2719. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2720. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2721. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2722. /// - \ref soundengine_banks
  2723. /// - \ref sdk_bank_training
  2724. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2725. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2726. AkUniqueID* in_pEventID, ///< Array of event IDs
  2727. AkUInt32 in_uNumEvent ///< Number of event IDs in the array
  2728. );
  2729. #ifdef AK_SUPPORT_WCHAR
  2730. /// Prepares or unprepares an event asynchronously (by Unicode string).
  2731. /// The Events are identified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2732. /// Before invoking PrepareEvent(), use LoadBank() to explicitly load the SoundBank(s)
  2733. /// that contain the Events and structures. When a request is posted to the
  2734. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2735. /// successfully post the specified Events and load the required loose media files.
  2736. /// \aknote Before version 2015.1, the required media files could be included
  2737. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2738. /// however, \c PrepareEvent() now only looks for loose media files.
  2739. /// \endaknote
  2740. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  2741. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  2742. /// \remarks
  2743. /// Whenever at least one Event fails to be resolved, the actions performed for all
  2744. /// other Events are cancelled.
  2745. /// \sa
  2746. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2747. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2748. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2749. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2750. /// - AkBankCallbackFunc
  2751. /// - \ref soundengine_banks
  2752. /// - \ref sdk_bank_training
  2753. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2754. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2755. const wchar_t** in_ppszString, ///< Array of event names
  2756. AkUInt32 in_uNumEvent, ///< Number of events in the array
  2757. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2758. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  2759. );
  2760. #endif //AK_SUPPORT_WCHAR
  2761. /// Prepares or unprepares an event asynchronously.
  2762. /// The Events are identified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2763. /// Before invoking PrepareEvent(), use LoadBank() to explicitly load the SoundBank(s)
  2764. /// that contain the Events and structures. When a request is posted to the
  2765. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2766. /// successfully post the specified Events and load the required loose media files.
  2767. /// \aknote Before version 2015.1, the required media files could be included
  2768. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2769. /// however, PrepareEvent() now only looks for loose media files.
  2770. /// \endaknote
  2771. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  2772. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  2773. /// \remarks
  2774. /// Whenever at least one event fails to be resolved, the actions performed for all
  2775. /// other events are cancelled.
  2776. /// \sa
  2777. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2778. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2779. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2780. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2781. /// - AkBankCallbackFunc
  2782. /// - \ref soundengine_banks
  2783. /// - \ref sdk_bank_training
  2784. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2785. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2786. const char** in_ppszString, ///< Array of event names
  2787. AkUInt32 in_uNumEvent, ///< Number of events in the array
  2788. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2789. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  2790. );
  2791. /// Prepares or unprepares events asynchronously (by ID).\n
  2792. /// The Events are identified by their ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2793. /// Before invoking PrepareEvent(), use LoadBank() to explicitly load the SoundBank(s)
  2794. /// that contain the Events and structures. When a request is posted to the
  2795. /// Bank Manager consumer thread, it will resolve all dependencies needed to
  2796. /// successfully post the specified Events and load the required loose media files.
  2797. /// \aknote Before version 2015.1, the required media files could be included
  2798. /// in a separate media SoundBank. As described in \ref whatsnew_2015_1_migration,
  2799. /// however, PrepareEvent() now only looks for loose media files.
  2800. /// \endaknote
  2801. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  2802. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  2803. /// \remarks
  2804. /// Whenever at least one event fails to be resolved, the actions performed for all
  2805. /// other events are cancelled.
  2806. /// \sa
  2807. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2808. /// - <tt>AK::SoundEngine::ClearPreparedEvents()</tt>
  2809. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2810. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2811. /// - AkBankCallbackFunc
  2812. /// - \ref soundengine_banks
  2813. /// - \ref sdk_bank_training
  2814. AK_EXTERNAPIFUNC( AKRESULT, PrepareEvent )(
  2815. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2816. AkUniqueID* in_pEventID, ///< Array of event IDs
  2817. AkUInt32 in_uNumEvent, ///< Number of event IDs in the array
  2818. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  2819. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  2820. );
  2821. /// Indicates the location of a specific Media ID in memory
  2822. /// The sources are identified by their ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2823. /// \return AK_Success if operation was successful, AK_InvalidParameter if in_pSourceSettings is invalid or media sizes are 0.
  2824. AK_EXTERNAPIFUNC( AKRESULT, SetMedia )(
  2825. AkSourceSettings * in_pSourceSettings, ///< Array of Source Settings
  2826. AkUInt32 in_uNumSourceSettings ///< Number of Source Settings in the array
  2827. );
  2828. /// Removes the specified source from the list of loaded media, even if this media is already in use.
  2829. /// The sources are identified by their ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2830. /// \aknote This function is unsafe and deprecated. Use TryUnsetMedia() in its place.
  2831. /// Media that is still in use by the sound engine should not be unset by this function.
  2832. /// If the media is still in use, this function will attempt to forcibly kill all sounds and effects referencing this media,
  2833. /// and then return AK_ResourceInUse. The client should NOT presume that the memory can be safely released at this point.
  2834. /// The moment at which the memory can be safely released is unknown, and the only safe course of action is to keep the memory
  2835. /// alive until the sound engine is terminated.
  2836. /// \endaknote
  2837. /// \return
  2838. /// - \c AK_Success: Operation was successful, and the memory can be released on the client side.
  2839. /// - \c AK_ResourceInUse: Specified media is still in use by the sound engine, the client should not release the memory.
  2840. /// - \c AK_InvalidParameter: in_pSourceSettings is invalid
  2841. AK_EXTERNAPIFUNC( AKRESULT, UnsetMedia )(
  2842. AkSourceSettings * in_pSourceSettings, ///< Array of Source Settings
  2843. AkUInt32 in_uNumSourceSettings ///< Number of Source Settings in the array
  2844. );
  2845. /// Removes the specified source from the list of loaded media, only if this media is not already in use.
  2846. /// The sources are identified by their ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2847. /// \aknote Media that is still in use by the sound engine should not be unset. It is marked for removal to prevent additional use.
  2848. /// If this function returns AK_ResourceInUse, then the client must not release memory for this media.
  2849. /// Instead, the client should retry the TryUnsetMedia operation later with the same parameters and check for AK_Success.
  2850. /// \endaknote
  2851. /// If out_pUnsetResults is not null, then it is assumed to point to an array of result codes of the same length as in_pSourceSettings.
  2852. /// out_pUnsetResults will be filled with either AK_Success or AK_ResourceInUse, indicating which media was still in use and not unset.
  2853. /// \return
  2854. /// - \c AK_Success: Operation was successful, and the memory can be released on the client side.
  2855. /// - \c AK_ResourceInUse: Specified media is still in use by the sound engine, and the media was not unset. Do not release memory, and try again later.
  2856. /// - \c AK_InvalidParameter: in_pSourceSettings is invalid
  2857. AK_EXTERNAPIFUNC(AKRESULT, TryUnsetMedia)(
  2858. AkSourceSettings* in_pSourceSettings, ///< Array of Source Settings
  2859. AkUInt32 in_uNumSourceSettings, ///< Number of Source Settings in the array
  2860. AKRESULT* out_pUnsetResults ///< (optional, can be null) Array of result codes
  2861. );
  2862. #ifdef AK_SUPPORT_WCHAR
  2863. /// Prepares or unprepares game syncs synchronously (by Unicode string).\n
  2864. /// The group and game syncs are specified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2865. /// The game syncs definitions must already exist in the sound engine by having
  2866. /// explicitly loaded the bank(s) that contain them (with LoadBank()).
  2867. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  2868. /// dependencies needed to successfully set this game sync group to one of the
  2869. /// game sync values specified, and load the required banks, if applicable.
  2870. /// The function returns when the request has been completely processed.
  2871. /// \return
  2872. /// - \c AK_Success: Prepare/un-prepare successful.
  2873. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareGameSyncs() does not exist.
  2874. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2875. /// - \c AK_BankReadError: I/O error.
  2876. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2877. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2878. /// - \c AK_InvalidFile: File specified could not be opened.
  2879. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2880. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2881. /// \remarks
  2882. /// You need to call PrepareGameSyncs() if the sound engine was initialized with AkInitSettings::bEnableGameSyncPreparation
  2883. /// set to true. When set to false, the sound engine automatically prepares all game syncs when preparing events,
  2884. /// so you never need to call this function.
  2885. /// \sa
  2886. /// - \c <tt>AK::SoundEngine::GetIDFromString()</tt>
  2887. /// - \c <tt>AK::SoundEngine::PrepareEvent()</tt>
  2888. /// - \c <tt>AK::SoundEngine::LoadBank()</tt>
  2889. /// - \c AkInitSettings
  2890. /// - \ref soundengine_banks
  2891. /// - \ref sdk_bank_training
  2892. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  2893. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2894. AkGroupType in_eGameSyncType, ///< The type of game sync.
  2895. const wchar_t* in_pszGroupName, ///< The State Group Name or the Switch Group Name.
  2896. const wchar_t** in_ppszGameSyncName, ///< The specific ID of the state to either support or not support.
  2897. AkUInt32 in_uNumGameSyncs ///< The number of game sync in the string array.
  2898. );
  2899. #endif //AK_SUPPORT_WCHAR
  2900. /// Prepares or unprepares game syncs synchronously.\n
  2901. /// The group and game syncs are specified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2902. /// The game syncs definitions must already exist in the sound engine by having
  2903. /// explicitly loaded the bank(s) that contain them (with LoadBank()).
  2904. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  2905. /// dependencies needed to successfully set this game sync group to one of the
  2906. /// game sync values specified, and load the required banks, if applicable.
  2907. /// The function returns when the request has been completely processed.
  2908. /// \return
  2909. /// - \c AK_Success: Prepare/un-prepare successful.
  2910. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareGameSyncs() does not exist.
  2911. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2912. /// - \c AK_BankReadError: I/O error.
  2913. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2914. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2915. /// - \c AK_InvalidFile: File specified could not be opened.
  2916. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2917. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2918. /// \remarks
  2919. /// You need to call PrepareGameSyncs() if the sound engine was initialized with AkInitSettings::bEnableGameSyncPreparation
  2920. /// set to true. When set to false, the sound engine automatically prepares all game syncs when preparing events,
  2921. /// so you never need to call this function.
  2922. /// \sa
  2923. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2924. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2925. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2926. /// - AkInitSettings
  2927. /// - \ref soundengine_banks
  2928. /// - \ref sdk_bank_training
  2929. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  2930. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2931. AkGroupType in_eGameSyncType, ///< The type of game sync.
  2932. const char* in_pszGroupName, ///< The State Group Name or the Switch Group Name.
  2933. const char** in_ppszGameSyncName, ///< The specific ID of the state to either support or not support.
  2934. AkUInt32 in_uNumGameSyncs ///< The number of game sync in the string array.
  2935. );
  2936. /// Prepares or unprepares game syncs synchronously (by ID).\n
  2937. /// The group and game syncs are specified by ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2938. /// The game syncs definitions must already exist in the sound engine by having
  2939. /// explicitly loaded the bank(s) that contain them (with LoadBank()).
  2940. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  2941. /// dependencies needed to successfully set this game sync group to one of the
  2942. /// game sync values specified, and load the required banks, if applicable.
  2943. /// The function returns when the request has been completely processed.
  2944. /// \return
  2945. /// - \c AK_Success: Prepare/un-prepare successful.
  2946. /// - \c AK_IDNotFound: At least one of the event/game sync identifiers passed to PrepareGameSyncs() does not exist.
  2947. /// - \c AK_InsufficientMemory: Insufficient memory to store bank data.
  2948. /// - \c AK_BankReadError: I/O error.
  2949. /// - \c AK_WrongBankVersion: Invalid bank version: make sure the version of Wwise that
  2950. /// you used to generate the SoundBanks matches that of the SDK you are currently using.
  2951. /// - \c AK_InvalidFile: File specified could not be opened.
  2952. /// - \c AK_InvalidParameter: Invalid parameter, invalid memory alignment.
  2953. /// - \c AK_Fail: Load or unload failed for any other reason. (Most likely small allocation failure)
  2954. /// \remarks
  2955. /// You need to call \c PrepareGameSyncs() if the sound engine was initialized with \c AkInitSettings::bEnableGameSyncPreparation
  2956. /// set to \c true. When set to \c false, the sound engine automatically prepares all game syncs when preparing Events,
  2957. /// so you never need to call this function.
  2958. /// \sa
  2959. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  2960. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  2961. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  2962. /// - AkInitSettings
  2963. /// - \ref soundengine_banks
  2964. /// - \ref sdk_bank_training
  2965. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  2966. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2967. AkGroupType in_eGameSyncType, ///< The type of game sync.
  2968. AkUInt32 in_GroupID, ///< The State Group ID or the Switch Group ID.
  2969. AkUInt32* in_paGameSyncID, ///< Array of ID of the game syncs to either support or not support.
  2970. AkUInt32 in_uNumGameSyncs ///< The number of game sync ID in the array.
  2971. );
  2972. #ifdef AK_SUPPORT_WCHAR
  2973. /// Prepares or unprepares game syncs asynchronously (by Unicode string).\n
  2974. /// The group and game syncs are specified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  2975. /// The game syncs definitions must already exist in the sound engine by having
  2976. /// explicitly loaded the bank(s) that contain them (with <tt>LoadBank()</tt>).
  2977. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  2978. /// dependencies needed to successfully set this game sync group to one of the
  2979. /// game sync values specified, and load the required banks, if applicable.
  2980. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  2981. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  2982. /// \remarks
  2983. /// You need to call \c PrepareGameSyncs() if the sound engine was initialized with \c AkInitSettings::bEnableGameSyncPreparation
  2984. /// set to \c true. When set to \c false, the sound engine automatically prepares all game syncs when preparing Events,
  2985. /// so you never need to call this function.
  2986. /// \sa
  2987. /// - \c <tt>AK::SoundEngine::GetIDFromString()</tt>
  2988. /// - \c <tt>AK::SoundEngine::PrepareEvent()</tt>
  2989. /// - \c <tt>AK::SoundEngine::LoadBank()</tt>
  2990. /// - \c AkInitSettings
  2991. /// - \c AkBankCallbackFunc
  2992. /// - \ref soundengine_banks
  2993. /// - \ref sdk_bank_training
  2994. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  2995. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  2996. AkGroupType in_eGameSyncType, ///< The type of game sync.
  2997. const wchar_t* in_pszGroupName, ///< The State Group Name or the Switch Group Name.
  2998. const wchar_t** in_ppszGameSyncName, ///< The specific ID of the state to either support or not support.
  2999. AkUInt32 in_uNumGameSyncs, ///< The number of game sync in the string array.
  3000. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  3001. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  3002. );
  3003. #endif //AK_SUPPORT_WCHAR
  3004. /// Prepares or unprepares game syncs asynchronously.\n
  3005. /// The group and game syncs are specified by string (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  3006. /// The game syncs definitions must already exist in the sound engine by having
  3007. /// explicitly loaded the bank(s) that contain them (with LoadBank()).
  3008. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  3009. /// dependencies needed to successfully set this game sync group to one of the
  3010. /// game sync values specified, and load the required banks, if applicable.
  3011. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  3012. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  3013. /// \remarks
  3014. /// You need to call PrepareGameSyncs() if the sound engine was initialized with AkInitSettings::bEnableGameSyncPreparation
  3015. /// set to true. When set to false, the sound engine automatically prepares all game syncs when preparing events,
  3016. /// so you never need to call this function.
  3017. /// \sa
  3018. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3019. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  3020. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  3021. /// - AkInitSettings
  3022. /// - AkBankCallbackFunc
  3023. /// - \ref soundengine_banks
  3024. /// - \ref sdk_bank_training
  3025. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  3026. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  3027. AkGroupType in_eGameSyncType, ///< The type of game sync.
  3028. const char* in_pszGroupName, ///< The State Group Name or the Switch Group Name.
  3029. const char** in_ppszGameSyncName, ///< The specific ID of the state to either support or not support.
  3030. AkUInt32 in_uNumGameSyncs, ///< The number of game sync in the string array.
  3031. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  3032. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  3033. );
  3034. /// Prepares or un-prepare game syncs asynchronously (by ID).\n
  3035. /// The group and game syncs are specified by ID (refer to \ref soundengine_banks_general for a discussion on using strings and IDs).
  3036. /// The game syncs definitions must already exist in the sound engine by having
  3037. /// explicitly loaded the bank(s) that contain them (with LoadBank()).
  3038. /// A request is posted to the Bank Manager consumer thread. It will resolve all
  3039. /// dependencies needed to successfully set this game sync group to one of the
  3040. /// game sync values specified, and load the required banks, if applicable.
  3041. /// The function returns immediately. Use a callback to be notified when the request has finished being processed.
  3042. /// \return AK_Success if scheduling is was successful, AK_Fail otherwise.
  3043. /// \remarks
  3044. /// You need to call PrepareGameSyncs() if the sound engine was initialized with AkInitSettings::bEnableGameSyncPreparation
  3045. /// set to true. When set to false, the sound engine automatically prepares all Game Syncs when preparing Events,
  3046. /// so you never need to call this function.
  3047. /// \sa
  3048. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3049. /// - <tt>AK::SoundEngine::PrepareEvent()</tt>
  3050. /// - <tt>AK::SoundEngine::LoadBank()</tt>
  3051. /// - AkInitSettings
  3052. /// - AkBankCallbackFunc
  3053. /// - \ref soundengine_banks
  3054. /// - \ref sdk_bank_training
  3055. AK_EXTERNAPIFUNC( AKRESULT, PrepareGameSyncs )(
  3056. PreparationType in_PreparationType, ///< Preparation type ( Preparation_Load or Preparation_Unload )
  3057. AkGroupType in_eGameSyncType, ///< The type of game sync.
  3058. AkUInt32 in_GroupID, ///< The State Group ID or the Switch Group ID.
  3059. AkUInt32* in_paGameSyncID, ///< Array of ID of the Game Syncs to either support or not support.
  3060. AkUInt32 in_uNumGameSyncs, ///< The number of game sync ID in the array.
  3061. AkBankCallbackFunc in_pfnBankCallback, ///< Callback function
  3062. void * in_pCookie ///< Callback cookie (reserved to user, passed to the callback function)
  3063. );
  3064. //@}
  3065. ////////////////////////////////////////////////////////////////////////
  3066. /// @name Listeners
  3067. //@{
  3068. /// Sets a game object's associated listeners.
  3069. /// All listeners that have previously been added via AddListener or set via SetListeners will be removed and replaced with the listeners in the array in_pListenerGameObjs.
  3070. /// Calling this function will override the default set of listeners and in_emitterGameObj will now reference its own, unique set of listeners.
  3071. /// \return
  3072. /// - \c AK_Success if successful
  3073. /// - \c AK_CommandTooLarge if the number of positions is too large for the command queue. Reduce the number of positions.
  3074. /// \sa
  3075. /// - <tt>AK::SoundEngine::AddListener</tt>
  3076. /// - <tt>AK::SoundEngine::RemoveListener</tt>
  3077. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3078. /// - \ref soundengine_listeners
  3079. AK_EXTERNAPIFUNC( AKRESULT, SetListeners )(
  3080. AkGameObjectID in_emitterGameObj, ///< Emitter game object. Must have been previously registered via RegisterGameObj.
  3081. const AkGameObjectID* in_pListenerGameObjs, ///< Array of listener game object IDs that will be activated for in_emitterGameObj.
  3082. AkUInt32 in_uNumListeners ///< Length of array
  3083. );
  3084. /// Add a single listener to a game object's set of associated listeners.
  3085. /// Any listeners that have previously been added or set via AddListener or SetListeners will remain as listeners and in_listenerGameObj will be added as an additional listener.
  3086. /// Calling this function will override the default set of listeners and in_emitterGameObj will now reference its own, unique set of listeners.
  3087. /// \sa
  3088. /// - <tt>AK::SoundEngine::SetListeners</tt>
  3089. /// - <tt>AK::SoundEngine::RemoveListener</tt>
  3090. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3091. /// - \ref soundengine_listeners
  3092. AK_EXTERNAPIFUNC(AKRESULT, AddListener)(
  3093. AkGameObjectID in_emitterGameObj, ///< Emitter game object. Must have been previously registered via RegisterGameObj.
  3094. AkGameObjectID in_listenerGameObj ///< Listener game object IDs that will be activated for in_emitterGameObj.
  3095. );
  3096. /// Remove a single listener from a game object's set of active listeners.
  3097. /// Calling this function will override the default set of listeners and in_emitterGameObj will now reference its own, unique set of listeners.
  3098. /// \sa
  3099. /// - <tt>AK::SoundEngine::SetListeners</tt>
  3100. /// - <tt>AK::SoundEngine::AddListener</tt>
  3101. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3102. /// - \ref soundengine_listeners
  3103. AK_EXTERNAPIFUNC(AKRESULT, RemoveListener)(
  3104. AkGameObjectID in_emitterGameObj, ///< Emitter game object.
  3105. AkGameObjectID in_listenerGameObj ///< Listener game object IDs that will be deactivated for in_emitterGameObj. Game objects must have been previously registered.
  3106. );
  3107. /// Sets the default set of associated listeners for game objects that have not explicitly overridden their listener sets. Upon registration, all game objects reference the default listener set, until
  3108. /// a call to AddListener, RemoveListener, SetListeners or SetGameObjectOutputBusVolume is made on that game object.
  3109. /// All default listeners that have previously been added via AddDefaultListener or set via SetDefaultListeners will be removed and replaced with the listeners in the array in_pListenerGameObjs.
  3110. /// \return Always returns AK_Success
  3111. /// \sa
  3112. /// - \ref soundengine_listeners
  3113. AK_EXTERNAPIFUNC(AKRESULT, SetDefaultListeners)(
  3114. const AkGameObjectID* in_pListenerObjs, ///< Array of listener game object IDs that will be activated for subsequent registrations. Game objects must have been previously registered.
  3115. AkUInt32 in_uNumListeners ///< Length of array
  3116. );
  3117. /// Add a single listener to the default set of listeners. Upon registration, all game objects reference the default listener set, until
  3118. /// a call to AddListener, RemoveListener, SetListeners or SetGameObjectOutputBusVolume is made on that game object.
  3119. /// \sa
  3120. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3121. /// - <tt>AK::SoundEngine::RemoveDefaultListener</tt>
  3122. /// - \ref soundengine_listeners
  3123. AK_EXTERNAPIFUNC(AKRESULT, AddDefaultListener)(
  3124. AkGameObjectID in_listenerGameObj ///< Listener game object IDs that will be added to the default set of listeners.
  3125. );
  3126. /// Remove a single listener from the default set of listeners. Upon registration, all game objects reference the default listener set, until
  3127. /// a call to AddListener, RemoveListener, SetListeners or SetGameObjectOutputBusVolume is made on that game object.
  3128. /// \sa
  3129. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3130. /// - <tt>AK::SoundEngine::AddDefaultListener</tt>
  3131. /// - \ref soundengine_listeners
  3132. AK_EXTERNAPIFUNC(AKRESULT, RemoveDefaultListener)(
  3133. AkGameObjectID in_listenerGameObj ///< Listener game object IDs that will be removed from the default set of listeners.
  3134. );
  3135. /// Resets the listener associations to the default listener(s), as set by <tt>SetDefaultListeners</tt>. This will also reset per-listener gains that have been set using <tt>SetGameObjectOutputBusVolume</tt>.
  3136. /// \return Always returns AK_Success
  3137. /// \sa
  3138. /// - <tt>AK::SoundEngine::SetListeners</tt>
  3139. /// - <tt>AK::SoundEngine::SetDefaultListeners</tt>
  3140. /// - <tt>AK::SoundEngine::SetGameObjectOutputBusVolume</tt>
  3141. /// - \ref soundengine_listeners
  3142. AK_EXTERNAPIFUNC(AKRESULT, ResetListenersToDefault)(
  3143. AkGameObjectID in_emitterGameObj ///< Emitter game object.
  3144. );
  3145. /// Sets a listener's spatialization parameters. This lets you define listener-specific
  3146. /// volume offsets for each audio channel.
  3147. /// If \c in_bSpatialized is false, only \c in_pVolumeOffsets is used for this listener (3D positions
  3148. /// have no effect on the speaker distribution). Otherwise, \c in_pVolumeOffsets is added to the speaker
  3149. /// distribution computed for this listener.
  3150. /// Use helper functions of \c AK::SpeakerVolumes to manipulate the vector of volume offsets in_pVolumeOffsets.
  3151. ///
  3152. /// \remarks
  3153. /// - If a sound is mixed into a bus that has a different speaker configuration than in_channelConfig,
  3154. /// standard up/downmix rules apply.
  3155. /// - Sounds with 3D Spatialization set to None will not be affected by these parameters.
  3156. /// \return
  3157. /// - \c AK_Success if message was successfully posted to sound engine queue
  3158. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  3159. /// - \c AK_InsufficientMemory if there wasn't enough memory in the message queue
  3160. /// \sa
  3161. /// - \ref soundengine_listeners_spatial
  3162. AK_EXTERNAPIFUNC( AKRESULT, SetListenerSpatialization )(
  3163. AkGameObjectID in_uListenerID, ///< Listener game object ID
  3164. bool in_bSpatialized, ///< Spatialization toggle (True : enable spatialization, False : disable spatialization)
  3165. AkChannelConfig in_channelConfig, ///< Channel configuration associated with volumes in_pVolumeOffsets. Ignored if in_pVolumeOffsets is NULL.
  3166. AK::SpeakerVolumes::VectorPtr in_pVolumeOffsets = NULL ///< Per-speaker volume offset, in dB. See AkSpeakerVolumes.h for how to manipulate this vector.
  3167. );
  3168. //@}
  3169. ////////////////////////////////////////////////////////////////////////
  3170. /// @name Game Syncs
  3171. //@{
  3172. /// Sets the value of a real-time parameter control (by ID).
  3173. /// With this function, you may set a game parameter value with global scope or with game object scope.
  3174. /// Game object scope supersedes global scope. (Once a value is set for the game object scope, it will not be affected by changes to the global scope value.) Game parameter values set with a global scope are applied to all
  3175. /// game objects that not yet registered, or already registered but not overridden with a value with game object scope.
  3176. /// To set a game parameter value with global scope, pass \c AK_INVALID_GAME_OBJECT as the game object.
  3177. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3178. /// value for \c in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3179. /// according to the interpolation curve. If you call \c <tt><tt>SetRTPCValue()</tt></tt> with <tt>in_uValueChangeDuration = 0</tt> in the
  3180. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3181. /// function at every game frame, you should not use \c in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3182. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3183. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3184. /// \return
  3185. /// - \c AK_Success if the value was successfully set
  3186. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3187. /// - \c AK_InvalidID if in_rtpcID is AK_INVALID_UNIQUE_ID (0)
  3188. /// \sa
  3189. /// - \ref soundengine_rtpc
  3190. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3191. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValue )(
  3192. AkRtpcID in_rtpcID, ///< ID of the game parameter
  3193. AkRtpcValue in_value, ///< Value to set
  3194. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3195. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3196. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3197. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3198. );
  3199. #ifdef AK_SUPPORT_WCHAR
  3200. /// Sets the value of a real-time parameter control (by Unicode string name).
  3201. /// With this function, you may set a game parameter value to global scope or to game object scope.
  3202. /// Game object scope supersedes global scope. (Once a value is set for the game object scope, it will not be affected by changes to the global scope value.) Game parameter values set with global scope are applied to all
  3203. /// game objects that not yet registered, or already registered but not overridden with a value with game object scope.
  3204. /// To set a game parameter value with global scope, pass AK_INVALID_GAME_OBJECT as the game object.
  3205. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3206. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3207. /// according to the interpolation curve. If you call SetRTPCValue() with in_uValueChangeDuration = 0 in the
  3208. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3209. /// function at every game frame, you should not use in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3210. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3211. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3212. /// \return
  3213. /// - \c AK_Success if the value was successfully set
  3214. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3215. /// - \c AK_InvalidID if in_pszRtpcName is NULL.
  3216. /// \aknote Strings are case-insensitive. \endaknote
  3217. /// \sa
  3218. /// - \ref soundengine_rtpc
  3219. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValue )(
  3220. const wchar_t* in_pszRtpcName, ///< Name of the game parameter
  3221. AkRtpcValue in_value, ///< Value to set
  3222. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3223. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3224. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3225. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3226. );
  3227. #endif //AK_SUPPORT_WCHAR
  3228. /// Sets the value of a real-time parameter control.
  3229. /// With this function, you may set a game parameter value with global scope or with game object scope.
  3230. /// Game object scope supersedes global scope. (Once a value is set for the game object scope, it will not be affected by changes to the global scope value.) Game parameter values set with global scope are applied to all
  3231. /// game objects that not yet registered, or already registered but not overridden with a value with game object scope.
  3232. /// To set a game parameter value with global scope, pass AK_INVALID_GAME_OBJECT as the game object.
  3233. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3234. /// value for \c in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3235. /// according to the interpolation curve. If you call SetRTPCValue() with in_uValueChangeDuration = 0 in the
  3236. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3237. /// function at every game frame, you should not use in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3238. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3239. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3240. /// \return
  3241. /// - \c AK_Success if the value was successfully set
  3242. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3243. /// - \c AK_InvalidID if in_pszRtpcName is NULL.
  3244. /// \aknote Strings are case-insensitive. \endaknote
  3245. /// \sa
  3246. /// - \ref soundengine_rtpc
  3247. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValue )(
  3248. const char* in_pszRtpcName, ///< Name of the game parameter
  3249. AkRtpcValue in_value, ///< Value to set
  3250. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3251. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3252. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3253. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3254. );
  3255. /// Sets the value of a real-time parameter control (by ID).
  3256. /// With this function, you may set a game parameter value on playing id scope.
  3257. /// Playing id scope supersedes both game object scope and global scope.
  3258. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3259. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3260. /// according to the interpolation curve. If you call SetRTPCValueByPlayingID() with in_uValueChangeDuration = 0 in the
  3261. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3262. /// function at every game frame, you should not use in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3263. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3264. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3265. /// - \c AK_Success if successful
  3266. /// - \c AK_PlayingIDNotFound if in_playingID is not found.
  3267. /// - \c AK_InvalidID if in_pszRtpcName is NULL.
  3268. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3269. /// \sa
  3270. /// - \ref soundengine_rtpc
  3271. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3272. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValueByPlayingID )(
  3273. AkRtpcID in_rtpcID, ///< ID of the game parameter
  3274. AkRtpcValue in_value, ///< Value to set
  3275. AkPlayingID in_playingID, ///< Associated playing ID
  3276. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3277. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3278. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when, for example, loading a level and you don't want the values to interpolate.
  3279. );
  3280. #ifdef AK_SUPPORT_WCHAR
  3281. /// Sets the value of a real-time parameter control (by Unicode string name).
  3282. /// With this function, you may set a game parameter value on playing ID scope.
  3283. /// Playing id scope supersedes both game object scope and global scope.
  3284. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3285. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3286. /// according to the interpolation curve. If you call SetRTPCValueByPlayingID() with in_uValueChangeDuration = 0 in the
  3287. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3288. /// function at every game frame, you should not use in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3289. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3290. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3291. /// - \c AK_Success if successful
  3292. /// - \c AK_PlayingIDNotFound if in_playingID is not found.
  3293. /// - \c AK_InvalidID if in_pszRtpcName is NULL.
  3294. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3295. /// \sa
  3296. /// - \ref soundengine_rtpc
  3297. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3298. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValueByPlayingID )(
  3299. const wchar_t* in_pszRtpcName, ///< Name of the game parameter
  3300. AkRtpcValue in_value, ///< Value to set
  3301. AkPlayingID in_playingID, ///< Associated playing ID
  3302. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3303. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3304. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when, for example, loading a level and you don't want the values to interpolate.
  3305. );
  3306. #endif //AK_SUPPORT_WCHAR
  3307. /// Sets the value of a real-time parameter control (by string name).
  3308. /// With this function, you may set a game parameter value on playing id scope.
  3309. /// Playing id scope supersedes both game object scope and global scope.
  3310. /// With this function, you may also change the value of a game parameter over time. To do so, specify a non-zero
  3311. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3312. /// according to the interpolation curve. If you call SetRTPCValueByPlayingID() with in_uValueChangeDuration = 0 in the
  3313. /// middle of an interpolation, the interpolation stops and the new value is set directly. Thus, if you call this
  3314. /// function at every game frame, you should not use in_uValueChangeDuration, as it would have no effect and it is less efficient.
  3315. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3316. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3317. /// - \c AK_Success if successful
  3318. /// - \c AK_PlayingIDNotFound if in_playingID is not found.
  3319. /// - \c AK_InvalidID if in_pszRtpcName is NULL.
  3320. /// - \c AK_InvalidFloatValue if the value specified was NaN, Inf or FLT_MAX (3.402823e+38)
  3321. /// \sa
  3322. /// - \ref soundengine_rtpc
  3323. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3324. AK_EXTERNAPIFUNC( AKRESULT, SetRTPCValueByPlayingID )(
  3325. const char* in_pszRtpcName, ///< Name of the game parameter
  3326. AkRtpcValue in_value, ///< Value to set
  3327. AkPlayingID in_playingID, ///< Associated playing ID
  3328. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
  3329. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3330. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3331. );
  3332. /// Resets the value of the game parameter to its default value, as specified in the Wwise project.
  3333. /// With this function, you may reset a game parameter to its default value with global scope or with game object scope.
  3334. /// Game object scope supersedes global scope. Game parameter values reset with global scope are applied to all
  3335. /// game objects that were not overridden with a value with game object scope.
  3336. /// To reset a game parameter value with global scope, pass AK_INVALID_GAME_OBJECT as the game object.
  3337. /// With this function, you may also reset the value of a game parameter over time. To do so, specify a non-zero
  3338. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3339. /// according to the interpolation curve. If you call SetRTPCValue() or ResetRTPCValue() with in_uValueChangeDuration = 0 in the
  3340. /// middle of an interpolation, the interpolation stops and the new value is set directly.
  3341. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3342. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3343. /// \return
  3344. /// - \c AK_Success when successful
  3345. /// - \c AK_InvalidID if in_rtpcID is AK_INVALID_UNIQUE_ID (0)
  3346. /// \sa
  3347. /// - \ref soundengine_rtpc
  3348. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3349. /// - <tt>AK::SoundEngine::SetRTPCValue()</tt>
  3350. AK_EXTERNAPIFUNC( AKRESULT, ResetRTPCValue )(
  3351. AkRtpcID in_rtpcID, ///< ID of the game parameter
  3352. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3353. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards its default value
  3354. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3355. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3356. );
  3357. #ifdef AK_SUPPORT_WCHAR
  3358. /// Resets the value of the game parameter to its default value, as specified in the Wwise project.
  3359. /// With this function, you may reset a game parameter to its default value with global scope or with game object scope.
  3360. /// Game object scope supersedes global scope. Game parameter values reset with global scope are applied to all
  3361. /// game objects that were not overridden with a value with game object scope.
  3362. /// To reset a game parameter value with global scope, pass AK_INVALID_GAME_OBJECT as the game object.
  3363. /// With this function, you may also reset the value of a game parameter over time. To do so, specify a non-zero
  3364. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3365. /// according to the interpolation curve. If you call SetRTPCValue() or ResetRTPCValue() with in_uValueChangeDuration = 0 in the
  3366. /// middle of an interpolation, the interpolation stops and the new value is set directly.
  3367. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3368. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3369. /// \return
  3370. /// - \c AK_Success if successful
  3371. /// - \c AK_InvalidID if in_pszParamName is NULL.
  3372. /// \aknote Strings are case-insensitive. \endaknote
  3373. /// \sa
  3374. /// - \ref soundengine_rtpc
  3375. /// - <tt>AK::SoundEngine::SetRTPCValue()</tt>
  3376. AK_EXTERNAPIFUNC( AKRESULT, ResetRTPCValue )(
  3377. const wchar_t* in_pszRtpcName, ///< Name of the game parameter
  3378. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3379. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards its default value
  3380. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3381. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3382. );
  3383. #endif //AK_SUPPORT_WCHAR
  3384. /// Resets the value of the game parameter to its default value, as specified in the Wwise project.
  3385. /// With this function, you may reset a game parameter to its default value with global scope or with game object scope.
  3386. /// Game object scope supersedes global scope. Game parameter values reset with global scope are applied to all
  3387. /// game objects that were not overridden with a value with game object scope.
  3388. /// To reset a game parameter value with global scope, pass AK_INVALID_GAME_OBJECT as the game object.
  3389. /// With this function, you may also reset the value of a game parameter over time. To do so, specify a non-zero
  3390. /// value for in_uValueChangeDuration. At each audio frame, the game parameter value will be updated internally
  3391. /// according to the interpolation curve. If you call SetRTPCValue() or ResetRTPCValue() with in_uValueChangeDuration = 0 in the
  3392. /// middle of an interpolation, the interpolation stops and the new value is set directly.
  3393. /// Refer to \ref soundengine_rtpc_pergameobject, \ref soundengine_rtpc_buses and
  3394. /// \ref soundengine_rtpc_effects for more details on RTPC scope.
  3395. /// \return
  3396. /// - \c AK_Success if successful
  3397. /// - \c AK_InvalidID if in_pszParamName is NULL.
  3398. /// \aknote Strings are case-insensitive. \endaknote
  3399. /// \sa
  3400. /// - \ref soundengine_rtpc
  3401. /// - <tt>AK::SoundEngine::SetRTPCValue()</tt>
  3402. AK_EXTERNAPIFUNC( AKRESULT, ResetRTPCValue )(
  3403. const char* in_pszRtpcName, ///< Name of the game parameter
  3404. AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
  3405. AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards its default value
  3406. AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
  3407. bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
  3408. );
  3409. /// Sets the State of a Switch Group (by IDs).
  3410. /// \return Always returns AK_Success
  3411. /// \sa
  3412. /// - \ref soundengine_switch
  3413. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3414. AK_EXTERNAPIFUNC( AKRESULT, SetSwitch )(
  3415. AkSwitchGroupID in_switchGroup, ///< ID of the Switch Group
  3416. AkSwitchStateID in_switchState, ///< ID of the Switch
  3417. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3418. );
  3419. #ifdef AK_SUPPORT_WCHAR
  3420. /// Sets the State of a Switch Group (by Unicode string names).
  3421. /// \return
  3422. /// - \c AK_Success if successful
  3423. /// - \c AK_InvalidID if the switch or Switch Group name was not resolved to an existing ID\n
  3424. /// Make sure that the banks were generated with the "include string" option.
  3425. /// \aknote Strings are case-insensitive. \endaknote
  3426. /// \sa
  3427. /// - \ref soundengine_switch
  3428. AK_EXTERNAPIFUNC( AKRESULT, SetSwitch )(
  3429. const wchar_t* in_pszSwitchGroup, ///< Name of the Switch Group
  3430. const wchar_t* in_pszSwitchState, ///< Name of the Switch
  3431. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3432. );
  3433. #endif //AK_SUPPORT_WCHAR
  3434. /// Sets the state of a Switch Group.
  3435. /// \return
  3436. /// - \c AK_Success if successful
  3437. /// - \c AK_InvalidID if the switch or Switch Group name was not resolved to an existing ID\n
  3438. /// Make sure that the banks were generated with the "include string" option.
  3439. /// \aknote Strings are case-insensitive. \endaknote
  3440. /// \sa
  3441. /// - \ref soundengine_switch
  3442. AK_EXTERNAPIFUNC( AKRESULT, SetSwitch )(
  3443. const char* in_pszSwitchGroup, ///< Name of the Switch Group
  3444. const char* in_pszSwitchState, ///< Name of the Switch
  3445. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3446. );
  3447. /// Post the specified trigger (by IDs).
  3448. /// \return Always returns AK_Success
  3449. /// \sa
  3450. /// - \ref soundengine_triggers
  3451. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3452. AK_EXTERNAPIFUNC( AKRESULT, PostTrigger )(
  3453. AkTriggerID in_triggerID, ///< ID of the trigger
  3454. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3455. );
  3456. #ifdef AK_SUPPORT_WCHAR
  3457. /// Posts the specified trigger (by Unicode string name).
  3458. /// \return
  3459. /// - \c AK_Success if successful
  3460. /// - \c AK_InvalidID if the trigger name was null
  3461. /// Make sure that the banks were generated with the "include string" option.
  3462. /// \aknote Strings are case-insensitive. \endaknote
  3463. /// \sa
  3464. /// - \ref soundengine_triggers
  3465. AK_EXTERNAPIFUNC( AKRESULT, PostTrigger )(
  3466. const wchar_t* in_pszTrigger, ///< Name of the trigger
  3467. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3468. );
  3469. #endif //AK_SUPPORT_WCHAR
  3470. /// Posts the specified trigger.
  3471. /// \return
  3472. /// - \c AK_Success if successful
  3473. /// - \c AK_InvalidID if the trigger name was null
  3474. /// Make sure that the banks were generated with the "include string" option.
  3475. /// \aknote Strings are case-insensitive. \endaknote
  3476. /// \sa
  3477. /// - \ref soundengine_triggers
  3478. AK_EXTERNAPIFUNC( AKRESULT, PostTrigger )(
  3479. const char* in_pszTrigger, ///< Name of the trigger
  3480. AkGameObjectID in_gameObjectID ///< Associated game object ID
  3481. );
  3482. /// Sets the state of a State Group (by IDs).
  3483. /// \return Always returns AK_Success
  3484. /// \sa
  3485. /// - \ref soundengine_states
  3486. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3487. AK_EXTERNAPIFUNC( AKRESULT, SetState )(
  3488. AkStateGroupID in_stateGroup, ///< ID of the State Group
  3489. AkStateID in_state ///< ID of the state
  3490. );
  3491. #ifdef AK_SUPPORT_WCHAR
  3492. /// Sets the state of a State Group (by Unicode string names).
  3493. /// \return
  3494. /// - \c AK_Success if successful
  3495. /// - \c AK_InvalidID if the state or State Group name was null
  3496. /// Make sure that the banks were generated with the "include string" option.
  3497. /// \aknote Strings are case-insensitive. \endaknote
  3498. /// \sa
  3499. /// - \ref soundengine_states
  3500. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3501. AK_EXTERNAPIFUNC( AKRESULT, SetState )(
  3502. const wchar_t* in_pszStateGroup, ///< Name of the State Group
  3503. const wchar_t* in_pszState ///< Name of the state
  3504. );
  3505. #endif //AK_SUPPORT_WCHAR
  3506. /// Sets the state of a State Group.
  3507. /// \return
  3508. /// - \c AK_Success if successful
  3509. /// - \c AK_InvalidID if the state or State Group name was null
  3510. /// Make sure that the banks were generated with the "include string" option.
  3511. /// \aknote Strings are case-insensitive. \endaknote
  3512. /// \sa
  3513. /// - \ref soundengine_states
  3514. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3515. AK_EXTERNAPIFUNC( AKRESULT, SetState )(
  3516. const char* in_pszStateGroup, ///< Name of the State Group
  3517. const char* in_pszState ///< Name of the state
  3518. );
  3519. //@}
  3520. ////////////////////////////////////////////////////////////////////////
  3521. /// @name Environments
  3522. //@{
  3523. /// Sets the Auxiliary Busses to route the specified game object
  3524. /// To clear the game object's auxiliary sends, \c in_uNumSendValues must be 0.
  3525. /// \sa
  3526. /// - \ref soundengine_environments
  3527. /// - \ref soundengine_environments_dynamic_aux_bus_routing
  3528. /// - \ref soundengine_environments_id_vs_string
  3529. /// - <tt>AK::SoundEngine::GetIDFromString()</tt>
  3530. /// \return
  3531. /// - \c AK_Success if successful
  3532. /// - \c AK_InvalidParameter if a duplicated environment is found in the array
  3533. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  3534. AK_EXTERNAPIFUNC( AKRESULT, SetGameObjectAuxSendValues )(
  3535. AkGameObjectID in_gameObjectID, ///< Associated game object ID
  3536. AkAuxSendValue* in_aAuxSendValues, ///< Variable-size array of AkAuxSendValue structures
  3537. ///< (it may be NULL if no environment must be set)
  3538. AkUInt32 in_uNumSendValues ///< The number of auxiliary busses at the pointer's address
  3539. ///< (it must be 0 if no environment is set)
  3540. );
  3541. /// Registers a callback to allow the game to modify or override the volume to be applied at the output of an audio bus.
  3542. /// The callback must be registered once per bus ID.
  3543. /// Call with <tt>in_pfnCallback = NULL</tt> to unregister.
  3544. /// \aknote The bus in_busID needs to be a mixing bus.\endaknote
  3545. /// \aknote The callback function will not be called for the Master Audio Bus, since the output of this bus is not a bus, but is instead an Audio Device.\endaknote
  3546. /// \sa
  3547. /// - \ref goingfurther_speakermatrixcallback
  3548. /// - \ref soundengine_environments
  3549. /// - AkSpeakerVolumeMatrixCallbackInfo
  3550. /// - <tt>AK::IAkMixerInputContext</tt>
  3551. /// - <tt>AK::IAkMixerPluginContext</tt>
  3552. /// \return
  3553. /// - \c AK_Success if successful
  3554. /// - \c AK_IDNotFound if the bus is not found
  3555. /// - \c AK_NotInitialized if the sound engine is not initialized
  3556. /// - \c AK_InsufficientMemory if there is not enough memory to complete the operation
  3557. AK_EXTERNAPIFUNC( AKRESULT, RegisterBusVolumeCallback )(
  3558. AkUniqueID in_busID, ///< Bus ID, as obtained by GetIDFromString( bus_name ).
  3559. AkBusCallbackFunc in_pfnCallback, ///< Callback function.
  3560. void* in_pCookie = NULL ///< User cookie.
  3561. );
  3562. /// Registers a callback to be called to allow the game to access metering data from any mixing bus. You may use this to monitor loudness at any point of the mixing hierarchy
  3563. /// by accessing the peak, RMS, True Peak and K-weighted power (according to loudness standard ITU BS.1770). See \ref goingfurther_speakermatrixcallback for an example.
  3564. /// The callback must be registered once per bus ID.
  3565. /// Call with in_pfnCallback = NULL to unregister.
  3566. /// \aknote The bus in_busID needs to be a mixing bus.\endaknote
  3567. /// \sa
  3568. /// - \ref goingfurther_speakermatrixcallback
  3569. /// - AkBusMeteringCallbackFunc
  3570. /// - <tt>AK::AkMetering</tt>
  3571. /// \return
  3572. /// - \c AK_Success if successful
  3573. /// - \c AK_IDNotFound if the bus is not found
  3574. /// - \c AK_NotInitialized if the sound engine is not initialized
  3575. /// - \c AK_InsufficientMemory if there is not enough memory to complete the operation
  3576. AK_EXTERNAPIFUNC( AKRESULT, RegisterBusMeteringCallback )(
  3577. AkUniqueID in_busID, ///< Bus ID, as obtained by GetIDFromString( bus_name ).
  3578. AkBusMeteringCallbackFunc in_pfnCallback, ///< Callback function.
  3579. AkMeteringFlags in_eMeteringFlags, ///< Metering flags.
  3580. void* in_pCookie = NULL ///< User cookie.
  3581. );
  3582. /// Registers a callback to be called to allow the game to access metering data from any output device. You may use this to monitor loudness as sound leaves the Wwise sound engine
  3583. /// by accessing the peak, RMS, True Peak and K-weighted power (according to loudness standard ITU BS.1770). See \ref goingfurther_speakermatrixcallback for an example.
  3584. /// The callback must be registered once per device shareset ID.
  3585. /// Call with in_pfnCallback = NULL to unregister.
  3586. /// \sa
  3587. /// - \ref goingfurther_speakermatrixcallback
  3588. /// - AkOutputDeviceMeteringCallbackFunc
  3589. /// - <tt>AK::AkMetering</tt>
  3590. /// \return
  3591. /// - \c AK_Success if successful
  3592. /// - \c AK_DeviceNotFound if the device is not found
  3593. /// - \c AK_NotInitialized if the sound engine is not initialized
  3594. /// - \c AK_InsufficientMemory if there is not enough memory to complete the operation
  3595. AK_EXTERNAPIFUNC( AKRESULT, RegisterOutputDeviceMeteringCallback )(
  3596. AkOutputDeviceID in_idOutput, ///< Output ID, as returned from AddOutput or GetOutputID. You can pass 0 for the main (default) output
  3597. AkOutputDeviceMeteringCallbackFunc in_pfnCallback, ///< Callback function.
  3598. AkMeteringFlags in_eMeteringFlags, ///< Metering flags.
  3599. void* in_pCookie = NULL ///< User cookie.
  3600. );
  3601. /// Sets the Output Bus Volume (direct) to be used for the specified game object.
  3602. /// The control value is a number ranging from 0.0f to 1.0f.
  3603. /// Output Bus Volumes are stored per listener association, so calling this function will override the default set of listeners. The game object in_emitterObjID will now reference its own set of listeners which will
  3604. /// be the same as the old set of listeners, but with the new associated gain. Future changes to the default listener set will not be picked up by this game object unless ResetListenersToDefault() is called.
  3605. /// \sa
  3606. /// - \ref AK::SoundEngine::ResetListenersToDefault
  3607. /// - \ref soundengine_environments
  3608. /// - \ref soundengine_environments_setting_dry_environment
  3609. /// - \ref soundengine_environments_id_vs_string
  3610. /// \return
  3611. /// - \c AK_Success when successful
  3612. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  3613. AK_EXTERNAPIFUNC( AKRESULT, SetGameObjectOutputBusVolume )(
  3614. AkGameObjectID in_emitterObjID, ///< Associated emitter game object ID
  3615. AkGameObjectID in_listenerObjID, ///< Associated listener game object ID. Pass AK_INVALID_GAME_OBJECT to set the Output Bus Volume for all connected listeners.
  3616. AkReal32 in_fControlValue ///< A multiplier in the range [0.0f:16.0f] ( -∞ dB to +24 dB).
  3617. ///< A value greater than 1.0f will amplify the sound.
  3618. );
  3619. /// Sets an Effect ShareSet at the specified audio node and Effect slot index.
  3620. /// \aknote
  3621. /// Replacing effects is preferably done through a Set Effect Event Action.
  3622. /// \endaknote
  3623. /// The target node cannot be a Bus, to set effects on a bus, use SetBusEffect() instead.
  3624. /// \aknote The option "Override Parent" in
  3625. /// the Effect section in Wwise must be enabled for this node, otherwise the parent's effect will
  3626. /// still be the one in use and the call to SetActorMixerEffect will have no impact.
  3627. /// \endaknote
  3628. /// \return Always returns AK_Success
  3629. AK_EXTERNAPIFUNC( AKRESULT, SetActorMixerEffect )(
  3630. AkUniqueID in_audioNodeID, ///< Can be a member of the Actor-Mixer or Interactive Music Hierarchy (not a bus).
  3631. AkUInt32 in_uFXIndex, ///< Effect slot index (0-3)
  3632. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to clear the effect slot
  3633. );
  3634. /// Sets an Effect ShareSet at the specified bus and Effect slot index.
  3635. /// \aknote
  3636. /// Replacing effects is preferably done through a Set Effect Event Action.
  3637. /// \endaknote
  3638. /// The Bus can either be an Audio Bus or an Auxiliary Bus.
  3639. /// This adds a reference on the audio node to an existing ShareSet.
  3640. /// \aknote This function has unspecified behavior when adding an Effect to a currently playing
  3641. /// Bus which does not have any Effects, or removing the last Effect on a currently playing bus.
  3642. /// \endaknote
  3643. /// \aknote This function will replace existing Effects on the node. If the target node is not at
  3644. /// the top of the hierarchy and is in the actor-mixer hierarchy, the option "Override Parent" in
  3645. /// the Effect section in Wwise must be enabled for this node, otherwise the parent's Effect will
  3646. /// still be the one in use and the call to SetBusEffect will have no impact.
  3647. /// \endaknote
  3648. /// \return
  3649. /// - \c AK_Success when successfully posted.
  3650. /// - \c AK_IDNotFound if the Bus isn't found by in_audioNodeID
  3651. /// - \c AK_InvalidParameter if in_uFXIndex isn't in range
  3652. AK_EXTERNAPIFUNC( AKRESULT, SetBusEffect )(
  3653. AkUniqueID in_audioNodeID, ///< Bus Short ID.
  3654. AkUInt32 in_uFXIndex, ///< Effect slot index (0-3)
  3655. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to clear the Effect slot
  3656. );
  3657. #ifdef AK_SUPPORT_WCHAR
  3658. /// Sets an Effect ShareSet at the specified Bus and Effect slot index.
  3659. /// \aknote
  3660. /// Replacing effects is preferably done through a Set Effect Event Action.
  3661. /// \endaknote
  3662. /// The Bus can either be an Audio Bus or an Auxiliary Bus.
  3663. /// This adds a reference on the audio node to an existing ShareSet.
  3664. /// \aknote This function has unspecified behavior when adding an Effect to a currently playing
  3665. /// bus which does not have any Effects, or removing the last Effect on a currently playing Bus.
  3666. /// \endaknote
  3667. /// \aknote This function will replace existing Effects on the node. If the target node is not at
  3668. /// the top of the hierarchy and is in the Actor-Mixer Hierarchy, the option "Override Parent" in
  3669. /// the Effect section in Wwise must be enabled for this node, otherwise the parent's Effect will
  3670. /// still be the one in use and the call to \c SetBusEffect will have no impact.
  3671. /// \endaknote
  3672. /// \returns
  3673. /// - \c AK_Success when successfully posted.
  3674. /// - \c AK_IDNotFound if the Bus name doesn't point to a valid bus.
  3675. /// - \c AK_InvalidID if in_pszBusName is null
  3676. /// - \c AK_InvalidParameter if in_uFXIndex isn't in range or in_pszBusName is null
  3677. AK_EXTERNAPIFUNC( AKRESULT, SetBusEffect )(
  3678. const wchar_t* in_pszBusName, ///< Bus name
  3679. AkUInt32 in_uFXIndex, ///< Effect slot index (0-3)
  3680. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to clear the effect slot
  3681. );
  3682. #endif //AK_SUPPORT_WCHAR
  3683. /// Sets an Effect ShareSet at the specified Bus and Effect slot index.
  3684. /// \aknote
  3685. /// Replacing effects is preferably done through a Set Effect Event Action.
  3686. /// \endaknote
  3687. /// The Bus can either be an Audio Bus or an Auxiliary Bus.
  3688. /// This adds a reference on the audio node to an existing ShareSet.
  3689. /// \aknote This function has unspecified behavior when adding an Effect to a currently playing
  3690. /// Bus which does not have any effects, or removing the last Effect on a currently playing bus.
  3691. /// \endaknote
  3692. /// \aknote Make sure the new effect shareset is included in a soundbank, and that sound bank is loaded. Otherwise you will see errors in the Capture Log.\endaknote
  3693. /// \aknote This function will replace existing Effects on the node. If the target node is not at
  3694. /// the top of the hierarchy and is in the Actor-Mixer Hierarchy, the option "Override Parent" in
  3695. /// the Effect section in Wwise must be enabled for this node, otherwise the parent's Effect will
  3696. /// still be the one in use and the call to SetBusEffect will have no impact.
  3697. /// \endaknote
  3698. /// \returns
  3699. /// - \c AK_Success when successfully posted.
  3700. /// - \c AK_IDNotFound if the Bus name doesn't point to a valid bus.
  3701. /// - \c AK_InvalidParameter if in_uFXIndex isn't in range
  3702. /// - \c AK_InvalidID if in_pszBusName is null
  3703. AK_EXTERNAPIFUNC( AKRESULT, SetBusEffect )(
  3704. const char* in_pszBusName, ///< Bus name
  3705. AkUInt32 in_uFXIndex, ///< Effect slot index (0-3)
  3706. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to clear the effect slot
  3707. );
  3708. /// Sets an audio device effect shareset on the specified output device and effect slot index.
  3709. /// \aknote
  3710. /// Replacing effects is preferably done through a Set Effect Event Action.
  3711. /// \endaknote
  3712. /// \aknote Make sure the new effect shareset is included in a soundbank, and that sound bank is loaded. Otherwise you will see errors in the Capture Log.\endaknote
  3713. /// \aknote This function will replace existing effects of the audio device shareset. \endaknote
  3714. /// \aknote Audio device effects support is limited to one shareset per plug-in type at any time. \endaknote
  3715. /// \aknote Errors are reported in the Wwise Capture Log if the effect cannot be set on the output device. \endaknote
  3716. /// \returns Always returns AK_Success
  3717. AK_EXTERNAPIFUNC(AKRESULT, SetOutputDeviceEffect)(
  3718. AkOutputDeviceID in_outputDeviceID, ///< Output ID, as returned from AddOutput or GetOutputID. Most of the time this should be 0 to designate the main (default) output
  3719. AkUInt32 in_uFXIndex, ///< Effect slot index (0-3)
  3720. AkUniqueID in_FXShareSetID ///< Effect ShareSet ID
  3721. );
  3722. /// Sets a Mixer ShareSet at the specified bus.
  3723. /// \aknote This function has unspecified behavior when adding a mixer to a currently playing
  3724. /// Bus which does not have any Effects or mixer, or removing the last mixer on a currently playing Bus.
  3725. /// \endaknote
  3726. /// \aknote Make sure the new mixer shareset is included in a soundbank, and that sound bank is loaded. Otherwise you will see errors in the Capture Log.\endaknote
  3727. /// \aknote This function will replace existing mixers on the node.
  3728. /// \endaknote
  3729. /// \return Always returns AK_Success
  3730. AK_EXTERNAPIFUNC( AKRESULT, SetMixer )(
  3731. AkUniqueID in_audioNodeID, ///< Bus Short ID.
  3732. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to remove.
  3733. );
  3734. #ifdef AK_SUPPORT_WCHAR
  3735. /// Sets a Mixer ShareSet at the specified bus.
  3736. /// \aknote This function has unspecified behavior when adding a mixer to a currently playing
  3737. /// bus which does not have any effects nor mixer, or removing the last mixer on a currently playing bus.
  3738. /// \endaknote
  3739. /// \aknote Make sure the new mixer shareset is included in a soundbank, and that sound bank is loaded. Otherwise you will see errors in the Capture Log.\endaknote
  3740. /// \aknote This function will replace existing mixers on the node.
  3741. /// \endaknote
  3742. /// \returns
  3743. /// - \c AK_Success when successful
  3744. /// - \c AK_InvalidID if in_pszBusName is null
  3745. AK_EXTERNAPIFUNC( AKRESULT, SetMixer )(
  3746. const wchar_t* in_pszBusName, ///< Bus name
  3747. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to remove.
  3748. );
  3749. #endif //AK_SUPPORT_WCHAR
  3750. /// Sets a Mixer ShareSet at the specified bus.
  3751. /// \aknote This function has unspecified behavior when adding a mixer to a currently playing
  3752. /// bus which does not have any effects nor mixer, or removing the last mixer on a currently playing bus.
  3753. /// \endaknote
  3754. /// \aknote Make sure the new mixer shareset is included in a soundbank, and that sound bank is loaded. Otherwise you will see errors in the Capture Log.\endaknote
  3755. /// \aknote This function will replace existing mixers on the node.
  3756. /// \endaknote
  3757. /// \returns
  3758. /// - \c AK_Success when successful
  3759. /// - \c AK_InvalidID if in_pszBusName is null
  3760. AK_EXTERNAPIFUNC( AKRESULT, SetMixer )(
  3761. const char* in_pszBusName, ///< Bus name
  3762. AkUniqueID in_shareSetID ///< ShareSets ID; pass AK_INVALID_UNIQUE_ID to remove.
  3763. );
  3764. /// Forces channel configuration for the specified bus.
  3765. /// \aknote You cannot change the configuration of the master bus.\endaknote
  3766. ///
  3767. /// \return Always returns AK_Success
  3768. AK_EXTERNAPIFUNC(AKRESULT, SetBusConfig)(
  3769. AkUniqueID in_audioNodeID, ///< Bus Short ID.
  3770. AkChannelConfig in_channelConfig ///< Desired channel configuration. An invalid configuration (from default constructor) means "as parent".
  3771. );
  3772. #ifdef AK_SUPPORT_WCHAR
  3773. /// Forces channel configuration for the specified bus.
  3774. /// \aknote You cannot change the configuration of the master bus.\endaknote
  3775. ///
  3776. /// \returns
  3777. /// - \c AK_Success when successful
  3778. /// - \c AK_InvalidID if in_pszBusName is null
  3779. AK_EXTERNAPIFUNC(AKRESULT, SetBusConfig)(
  3780. const wchar_t* in_pszBusName, ///< Bus name
  3781. AkChannelConfig in_channelConfig ///< Desired channel configuration. An invalid configuration (from default constructor) means "as parent".
  3782. );
  3783. #endif //AK_SUPPORT_WCHAR
  3784. /// Forces channel configuration for the specified bus.
  3785. /// \aknote You cannot change the configuration of the master bus.\endaknote
  3786. ///
  3787. /// \returns
  3788. /// - \c AK_Success when successful
  3789. /// - \c AK_InvalidID if in_pszBusName is null
  3790. AK_EXTERNAPIFUNC(AKRESULT, SetBusConfig)(
  3791. const char* in_pszBusName, ///< Bus name
  3792. AkChannelConfig in_channelConfig ///< Desired channel configuration. An invalid configuration (from default constructor) means "as parent".
  3793. );
  3794. /// Sets a game object's obstruction and occlusion levels. If SetMultiplePositions were used, values are set for all positions.
  3795. /// This function is used to affect how an object should be heard by a specific listener.
  3796. /// \sa
  3797. /// - \ref soundengine_obsocc
  3798. /// - \ref soundengine_environments
  3799. /// \return Always returns AK_Success
  3800. AK_EXTERNAPIFUNC( AKRESULT, SetObjectObstructionAndOcclusion )(
  3801. AkGameObjectID in_EmitterID, ///< Emitter game object ID
  3802. AkGameObjectID in_ListenerID, ///< Listener game object ID
  3803. AkReal32 in_fObstructionLevel, ///< ObstructionLevel: [0.0f..1.0f]
  3804. AkReal32 in_fOcclusionLevel ///< OcclusionLevel: [0.0f..1.0f]
  3805. );
  3806. /// Sets a game object's obstruction and occlusion level for each positions defined by SetMultiplePositions.
  3807. /// This function differs from SetObjectObstructionAndOcclusion as a list of obstruction/occlusion pair is provided
  3808. /// and each obstruction/occlusion pair will affect the corresponding position defined at the same index.
  3809. /// \aknote In the case the number of obstruction/occlusion pairs is smaller than the number of positions, remaining positions'
  3810. /// obstrucion/occlusion values are set to 0.0. \endaknote
  3811. /// \return
  3812. /// - \c AK_Success if successful
  3813. /// - \c AK_CommandTooLarge if the number of obstruction values is too large for the command queue.
  3814. /// - \c AK_InvalidParameter if one of the parameter is out of range (check the debug console)
  3815. /// - \c AK_InvalidFloatValue if one of the occlusion/obstruction values is NaN or Inf.
  3816. /// \sa
  3817. /// - \ref soundengine_obsocc
  3818. /// - \ref soundengine_environments
  3819. /// \return AK_Success if occlusion/obstruction values are successfully stored for this emitter
  3820. AK_EXTERNAPIFUNC( AKRESULT, SetMultipleObstructionAndOcclusion )(
  3821. AkGameObjectID in_EmitterID, ///< Emitter game object ID
  3822. AkGameObjectID in_uListenerID, ///< Listener game object ID
  3823. AkObstructionOcclusionValues* in_fObstructionOcclusionValues, ///< Array of obstruction/occlusion pairs to apply
  3824. ///< ObstructionLevel: [0.0f..1.0f]
  3825. ///< OcclusionLevel: [0.0f..1.0f]
  3826. AkUInt32 in_uNumOcclusionObstruction ///< Number of obstruction/occlusion pairs specified in the provided array
  3827. );
  3828. /// Saves the playback history of container structures.
  3829. /// This function will write history data for all currently loaded containers and instantiated game
  3830. /// objects (for example, current position in Sequence Containers and previously played elements in
  3831. /// Random Containers).
  3832. /// \remarks
  3833. /// This function acquires the main audio lock, and may block the caller for several milliseconds.
  3834. /// \return
  3835. /// - \c AK_Success when successful
  3836. /// - \c AK_Fail is in_pBytes could not be parsed (corruption or data is truncated)
  3837. /// \sa
  3838. /// - <tt>AK::SoundEngine::SetContainerHistory()</tt>
  3839. AK_EXTERNAPIFUNC( AKRESULT, GetContainerHistory)(
  3840. AK::IWriteBytes * in_pBytes ///< Pointer to IWriteBytes interface used to save the history.
  3841. );
  3842. /// Restores the playback history of container structures.
  3843. /// This function will read history data from the passed-in stream reader interface, and apply it to all
  3844. /// currently loaded containers and instantiated game objects. Game objects are matched by
  3845. /// ID. History for unloaded structures and unknown game objects will be skipped.
  3846. /// \remarks
  3847. /// This function acquires the main audio lock, and may block the caller for several milliseconds.
  3848. /// \return
  3849. /// - \c AK_Success if successful
  3850. /// - \c AK_InsufficientMemory if not enough memory is available for IReadBytes operation
  3851. /// \sa
  3852. /// - <tt>AK::SoundEngine::GetContainerHistory()</tt>
  3853. AK_EXTERNAPIFUNC(AKRESULT, SetContainerHistory)(
  3854. AK::IReadBytes * in_pBytes ///< Pointer to IReadBytes interface used to load the history.
  3855. );
  3856. //@}
  3857. ////////////////////////////////////////////////////////////////////////
  3858. /// @name Capture
  3859. //@{
  3860. /// Starts recording the sound engine audio output.
  3861. /// StartOutputCapture outputs a wav file per current output device of the sound engine.
  3862. /// If more than one device is active, the system will create multiple files in the same output
  3863. /// directory and will append numbers at the end of the provided filename.
  3864. ///
  3865. /// If no device is running yet, the system will return success AK_Success despite doing nothing.
  3866. /// Use RegisterAudioDeviceStatusCallback to get notified when devices are created/destructed.
  3867. ///
  3868. /// \return AK_Success if successful, AK_Fail if there was a problem starting the output capture.
  3869. /// \remark
  3870. /// - The sound engine opens a stream for writing using <tt>AK::IAkStreamMgr::CreateStd()</tt>. If you are using the
  3871. /// default implementation of the Stream Manager, file opening is executed in your implementation of
  3872. /// the Low-Level IO interface <tt>AK::StreamMgr::IAkFileLocationResolver::Open()</tt>. The following
  3873. /// AkFileSystemFlags are passed: uCompanyID = AKCOMPANYID_AUDIOKINETIC and uCodecID = AKCODECID_PCM,
  3874. /// and the AkOpenMode is AK_OpenModeWriteOvrwr. Refer to \ref streamingmanager_lowlevel_location for
  3875. /// more details on managing the deployment of your Wwise generated data.
  3876. /// \return
  3877. /// - \c AK_Success when successful
  3878. /// - \c AK_InvalidParameter if in_CaptureFileName is null.
  3879. /// - \c AK_InsufficientMemory if not enough memory is available.
  3880. /// \sa
  3881. /// - <tt>AK::SoundEngine::StopOutputCapture()</tt>
  3882. /// - <tt>AK::StreamMgr::SetFileLocationResolver()</tt>
  3883. /// - \ref streamingdevicemanager
  3884. /// - \ref streamingmanager_lowlevel_location
  3885. /// - RegisterAudioDeviceStatusCallback
  3886. AK_EXTERNAPIFUNC( AKRESULT, StartOutputCapture )(
  3887. const AkOSChar* in_CaptureFileName ///< Name of the output capture file
  3888. );
  3889. /// Stops recording the sound engine audio output.
  3890. /// \return AK_Success if successful, AK_Fail if there was a problem stopping the output capture.
  3891. /// \sa
  3892. /// - <tt>AK::SoundEngine::StartOutputCapture()</tt>
  3893. AK_EXTERNAPIFUNC( AKRESULT, StopOutputCapture )();
  3894. /// Adds text marker in audio output file.
  3895. /// \return
  3896. /// - \c AK_Success when successful
  3897. /// - \c AK_InvalidParameter if in_MarkerText is null.
  3898. /// - \c AK_InsufficientMemory if not enough memory is available.
  3899. /// \sa
  3900. /// - <tt>AK::SoundEngine::StartOutputCapture()</tt>
  3901. AK_EXTERNAPIFUNC( AKRESULT, AddOutputCaptureMarker )(
  3902. const char* in_MarkerText ///< Text of the marker
  3903. );
  3904. /// Gets the system sample rate.
  3905. /// \return The sample rate.
  3906. AK_EXTERNAPIFUNC(AkUInt32, GetSampleRate)();
  3907. /// Registers a callback used for retrieving audio samples.
  3908. /// The callback will be called from the audio thread during real-time rendering and from the main thread during offline rendering.
  3909. /// \return
  3910. /// - \c AK_Success when successful
  3911. /// - \c AK_DeviceNotFound if the audio device ID doesn't match to a device in use.
  3912. /// - \c AK_InvalidParameter when in_pfnCallback is null
  3913. /// - \c AK_NotInitialized if the sound engine is not initialized at this time
  3914. /// \sa
  3915. /// - <tt>AK::SoundEngine::AddOutput()</tt>
  3916. /// - <tt>AK::SoundEngine::GetOutputID()</tt>
  3917. /// - <tt>AK::SoundEngine::UnregisterCaptureCallback()</tt>
  3918. AK_EXTERNAPIFUNC(AKRESULT, RegisterCaptureCallback)(
  3919. AkCaptureCallbackFunc in_pfnCallback, ///< Capture callback function to register.
  3920. AkOutputDeviceID in_idOutput = AK_INVALID_OUTPUT_DEVICE_ID, ///< The audio device specific id, return by AK::SoundEngine::AddOutput or AK::SoundEngine::GetOutputID
  3921. void* in_pCookie = NULL ///< Callback cookie that will be sent to the callback function along with additional information
  3922. );
  3923. /// Unregisters a callback used for retrieving audio samples.
  3924. /// \return
  3925. /// - \c AK_Success when successful
  3926. /// - \c AK_DeviceNotFound if the audio device ID doesn't match to a device in use.
  3927. /// - \c AK_InvalidParameter when in_pfnCallback is null
  3928. /// - \c AK_NotInitialized if the sound engine is not initialized at this time
  3929. /// \sa
  3930. /// - <tt>AK::SoundEngine::AddOutput()</tt>
  3931. /// - <tt>AK::SoundEngine::GetOutputID()</tt>
  3932. /// - <tt>AK::SoundEngine::RegisterCaptureCallback()</tt>
  3933. AK_EXTERNAPIFUNC(AKRESULT, UnregisterCaptureCallback)(
  3934. AkCaptureCallbackFunc in_pfnCallback, ///< Capture callback function to unregister.
  3935. AkOutputDeviceID in_idOutput = AK_INVALID_OUTPUT_DEVICE_ID, ///< The audio device specific id, return by AK::SoundEngine::AddOutput or AK::SoundEngine::GetOutputID
  3936. void* in_pCookie = NULL ///< Callback cookie that will be sent to the callback function along with additional information
  3937. );
  3938. /// Starts recording the sound engine profiling information into a file. This file can be read
  3939. /// by Wwise Authoring. The file is created at the base path. If you have integrated Wwise I/O,
  3940. /// you can use <tt>CAkDefaultIOHookBlocking::SetBasePath()</tt> (or <tt>CAkDefaultIOHookBlocking::AddBasePath()</tt>)
  3941. /// to change the location where the file is saved. The profiling session records all data types possible.
  3942. /// Note that this call captures peak metering for all the busses loaded and mixing
  3943. /// while this call is invoked.
  3944. /// \remark This function is provided as a utility tool only. It does nothing if it is
  3945. /// called in the release configuration and returns AK_NotCompatible.
  3946. AK_EXTERNAPIFUNC( AKRESULT, StartProfilerCapture )(
  3947. const AkOSChar* in_CaptureFileName ///< Name of the output profiler file (.prof extension recommended)
  3948. );
  3949. /// Stops recording the sound engine profiling information.
  3950. /// \remark This function is provided as a utility tool only. It does nothing if it is
  3951. /// called in the release configuration and returns AK_NotCompatible.
  3952. AK_EXTERNAPIFUNC( AKRESULT, StopProfilerCapture )();
  3953. //@}
  3954. ////////////////////////////////////////////////////////////////////////
  3955. /// @name Offline Rendering
  3956. //@{
  3957. /// Sets the offline rendering frame time in seconds.
  3958. /// When offline rendering is enabled, every call to \ref RenderAudio() will generate sample data as if this much time has elapsed. If the frame time argument is less than or equal to zero, every call to RenderAudio() will generate one audio buffer.
  3959. /// \return Always returns AK_Success
  3960. AK_EXTERNAPIFUNC(AKRESULT, SetOfflineRenderingFrameTime)(
  3961. AkReal32 in_fFrameTimeInSeconds ///< frame time in seconds used during offline rendering
  3962. );
  3963. /// Enables/disables offline rendering.
  3964. /// \return Always returns AK_Success
  3965. AK_EXTERNAPIFUNC(AKRESULT, SetOfflineRendering)(
  3966. bool in_bEnableOfflineRendering ///< enables/disables offline rendering
  3967. );
  3968. //@}
  3969. ////////////////////////////////////////////////////////////////////////
  3970. /// @name Secondary Outputs
  3971. //@{
  3972. /// Adds an output to the sound engine. Use this to add controller-attached headphones, controller speakers, DVR output, etc.
  3973. /// The in_Settings parameter contains an Audio Device shareset to specify the output plugin to use and a device ID to specify the instance, if necessary (e.g. which game controller).
  3974. ///
  3975. /// Like most functions of AK::SoundEngine, AddOutput is asynchronous. A successful return code merely indicates that the request is properly queued.
  3976. /// Error codes returned by this function indicate various invalid parameters. To know if this function succeeds or not, and the failure code,
  3977. /// register an AkDeviceStatusCallbackFunc callback with RegisterAudioDeviceStatusCallback.
  3978. ///
  3979. /// \sa AkOutputSettings for more details.
  3980. /// \sa \ref integrating_secondary_outputs
  3981. /// \sa \ref default_audio_devices
  3982. /// \sa AK::SoundEngine::RegisterAudioDeviceStatusCallback
  3983. /// \sa AK::AkDeviceStatusCallbackFunc
  3984. /// \return
  3985. /// The following codes are returned directly from the function, as opposed to the AkDeviceStatusCallback
  3986. /// - \c AK_NotImplemented: Feature not supported, some platforms don't have other outputs.
  3987. /// - \c AK_InvalidParameter: Out of range parameters or unsupported parameter combinations (see parameter list below).
  3988. /// - \c AK_IDNotFound: The audioDeviceShareset on in_settings doesn't exist. Possibly, the Init bank isn't loaded yet or was not updated with latest changes.
  3989. /// - \c AK_DeviceNotReady: The idDevice on in_settings doesn't match with a valid hardware device. Either the device doesn't exist or is disabled. Disconnected devices (headphones) are not considered "not ready" therefore won't cause this error.
  3990. /// - \c AK_NotInitialized: If AK::SoundEngine::Init was not called or if the Init.bnk was not loaded before the call.
  3991. /// - \c AK_Success: Parameters are valid.
  3992. ///
  3993. /// The following codes are returned from the callback.
  3994. /// - \c AK_InsufficientMemory : Not enough memory to complete the operation.
  3995. /// - \c AK_IDNotFound: The audioDeviceShareset on in_settings doesn't exist. Possibly, the Init bank isn't loaded yet or was not updated with latest changes.
  3996. /// - \c AK_PluginNotRegistered: The audioDeviceShareset exists but the plug-in it refers to is not installed or statically linked with the game.
  3997. /// - \c AK_NotCompatible: The hardware does not support this type of output. Wwise will try to use the System output instead, and a separate callback will fire when that completes.
  3998. /// - \c AK_DeviceNotCompatible: The hardware does not support this type of output. Wwise will NOT fallback to any other type of output.
  3999. /// - \c AK_Fail: Generic code for any non-permanent conditions (e.g. disconnection) that prevent the use of the output. Wwise has created the output and sounds will be routed to it, but this output is currently silent until the temporary condition resolves.
  4000. /// - \c AK_NoDistinctListener: Outputs of the same type (same ShareSet, like controller speakers) must have distinct Listeners to make a proper routing. This doesn't happen if there is only one output of that type.
  4001. AK_EXTERNAPIFUNC(AKRESULT, AddOutput)(
  4002. const AkOutputSettings & in_Settings, ///< Creation parameters for this output. \ref AkOutputSettings
  4003. AkOutputDeviceID *out_pDeviceID = NULL, ///< (Optional) Output ID to use with all other Output management functions. Leave to NULL if not required. \ref AK::SoundEngine::GetOutputID
  4004. const AkGameObjectID* in_pListenerIDs = NULL, ///< Specific listener(s) to attach to this device.
  4005. ///< If specified, only the sounds routed to game objects linked to those listeners will play in this device.
  4006. ///< It is necessary to have separate listeners if multiple devices of the same type can coexist (e.g. controller speakers)
  4007. ///< If not specified, sound routing simply obey the associations between Master Busses and Audio Devices setup in the Wwise Project.
  4008. AkUInt32 in_uNumListeners = 0 ///< The number of elements in the in_pListenerIDs array.
  4009. );
  4010. /// Removes one output added through AK::SoundEngine::AddOutput
  4011. /// If a listener was associated with the device, you should consider unregistering the listener prior to call RemoveOutput
  4012. /// so that Game Object/Listener routing is properly updated according to your game scenario.
  4013. /// \sa \ref integrating_secondary_outputs
  4014. /// \sa AK::SoundEngine::AddOutput
  4015. /// \return AK_Success: Parameters are valid.
  4016. AK_EXTERNAPIFUNC(AKRESULT, RemoveOutput)(
  4017. AkOutputDeviceID in_idOutput ///< ID of the output to remove. Use the returned ID from AddOutput, GetOutputID, or ReplaceOutput
  4018. );
  4019. /// Replaces an output device previously created during engine initialization or from AddOutput, with a new output device.
  4020. /// In addition to simply removing one output device and adding a new one, the new output device will also be used on all of the master buses
  4021. /// that the old output device was associated with, and preserve all listeners that were attached to the old output device.
  4022. ///
  4023. /// Like most functions of AK::SoundEngine, AddOutput is asynchronous. A successful return code merely indicates that the request is properly queued.
  4024. /// Error codes returned by this function indicate various invalid parameters. To know if this function succeeds or not, and the failure code,
  4025. /// register an AkDeviceStatusCallbackFunc callback with RegisterAudioDeviceStatusCallback.
  4026. ///
  4027. /// \sa AK::SoundEngine::AddOutput
  4028. /// \sa AK::SoundEngine::RegisterAudioDeviceStatusCallback
  4029. /// \sa AK::AkDeviceStatusCallbackFunc
  4030. /// \return
  4031. /// - \c AK_InvalidID: The audioDeviceShareset on in_settings was not valid.
  4032. /// - \c AK_IDNotFound: The audioDeviceShareset on in_settings doesn't exist. Possibly, the Init bank isn't loaded yet or was not updated with latest changes.
  4033. /// - \c AK_DeviceNotReady: The idDevice on in_settings doesn't match with a valid hardware device. Either the device doesn't exist or is disabled. Disconnected devices (headphones) are not considered "not ready" therefore won't cause this error.
  4034. /// - \c AK_DeviceNotFound: The in_outputDeviceId provided does not match with any of the output devices that the sound engine is currently using.
  4035. /// - \c AK_InvalidParameter: Out of range parameters or unsupported parameter combinations on in_settings
  4036. /// - \c AK_Success: parameters were valid, and the remove and add will occur.
  4037. AK_EXTERNAPIFUNC(AKRESULT, ReplaceOutput)(
  4038. const AkOutputSettings & in_Settings, ///< Creation parameters for this output. \ref AkOutputSettings
  4039. AkOutputDeviceID in_outputDeviceId, ///< AkOutputDeviceID of the output to replace. Use 0 to target the current main output, regardless of its id. Otherwise, use the AkOuptutDeviceID returned from AddOutput() or ReplaceOutput(), or generated by GetOutputID()
  4040. AkOutputDeviceID *out_pOutputDeviceId = NULL ///< (Optional) Pointer into which the method writes the AkOutputDeviceID of the new output device. If the call fails, the value pointed to will not be modified.
  4041. );
  4042. /// Gets the compounded output ID from shareset and device id.
  4043. /// Outputs are defined by their type (Audio Device shareset) and their specific system ID. A system ID could be reused for other device types on some OS or platforms, hence the compounded ID.
  4044. /// Use 0 for in_idShareset & in_idDevice to get the Main Output ID (the one usually initialized during AK::SoundEngine::Init)
  4045. /// \return The id of the output
  4046. AK_EXTERNAPIFUNC(AkOutputDeviceID, GetOutputID)(
  4047. AkUniqueID in_idShareset, ///< Audio Device ShareSet ID, as defined in the Wwise Project. If needed, use AK::SoundEngine::GetIDFromString() to convert from a string. Set to AK_INVALID_UNIQUE_ID to use the default.
  4048. AkUInt32 in_idDevice ///< Device specific identifier, when multiple devices of the same type are possible. If only one device is possible, leave to 0.
  4049. /// \sa \ref obtaining_device_id
  4050. );
  4051. AK_EXTERNAPIFUNC(AkOutputDeviceID, GetOutputID)(
  4052. const char* in_szShareSet, ///< Audio Device ShareSet Name, as defined in the Wwise Project. If Null, will select the Default Output shareset (always available)
  4053. AkUInt32 in_idDevice ///< Device specific identifier, when multiple devices of the same type are possible. If only one device is possible, leave to 0.
  4054. /// \sa \ref obtaining_device_id
  4055. );
  4056. #ifdef AK_SUPPORT_WCHAR
  4057. AK_EXTERNAPIFUNC(AkOutputDeviceID, GetOutputID)(
  4058. const wchar_t* in_szShareSet, ///< Audio Device ShareSet Name, as defined in the Wwise Project. If Null, will select the Default Output shareset (always available)
  4059. AkUInt32 in_idDevice ///< Device specific identifier, when multiple devices of the same type are possible. If only one device is possible, leave to 0.
  4060. /// \sa \ref obtaining_device_id
  4061. );
  4062. #endif
  4063. /// Sets the Audio Device to which a master bus outputs. This overrides the setting in the Wwise project.
  4064. /// Can only be set on top-level busses. The Init bank should be successfully loaded prior to this call.
  4065. /// \aknote This function is useful only if used before the creation of an output, at the beginning of the sound engine setup.
  4066. /// Once active outputs using this Bus have been created, it is imperative to use AK::SoundEngine:ReplaceOutput instead to change the type of output.
  4067. /// \return
  4068. /// AK_IDNotFound when either the Bus ID or the Device ID are not present in the Init bank or the bank was not loaded
  4069. /// AK_InvalidParameter when the specified bus is not a Master Bus. This function can be called only on busses that have no parent bus.
  4070. AK_EXTERNAPIFUNC(AKRESULT, SetBusDevice)(
  4071. AkUniqueID in_idBus, ///< Id of the master bus
  4072. AkUniqueID in_idNewDevice ///< New device shareset to replace with.
  4073. );
  4074. /// Sets the Audio Device to which a master bus outputs. This overrides the setting in the Wwise project.
  4075. /// Can only be set on top-level busses. The Init bank should be successfully loaded prior to this call.
  4076. /// \aknote This function is useful only if used before the creation of an output, at the beginning of the sound engine setup.
  4077. /// Once active outputs using this Bus have been created, it is imperative to use AK::SoundEngine:ReplaceOutput instead to change the type of output.
  4078. /// \return
  4079. /// AK_IDNotFound when either the Bus ID or the Device ID are not present in the Init bank or the bank was not loaded
  4080. /// AK_InvalidParameter when the specified bus is not a Master Bus. This function can be called only on busses that have no parent bus.
  4081. AK_EXTERNAPIFUNC(AKRESULT, SetBusDevice)(
  4082. const char* in_BusName, ///< Name of the master bus
  4083. const char* in_DeviceName ///< New device shareset to replace with.
  4084. );
  4085. #ifdef AK_SUPPORT_WCHAR
  4086. /// Sets the Audio Device to which a master bus outputs. This overrides the setting in the Wwise project.
  4087. /// Can only be set on top-level busses. The Init bank should be successfully loaded prior to this call.
  4088. /// SetBusDevice must be preceded by a call to AddOutput for the new device shareset to be registered as an output.
  4089. /// \return
  4090. /// AK_IDNotFound when either the Bus ID or the Device ID are not present in the Init bank or the bank was not loaded
  4091. /// AK_InvalidParameter when the specified bus is not a Master Bus. This function can be called only on busses that have no parent bus.
  4092. AK_EXTERNAPIFUNC(AKRESULT, SetBusDevice)(
  4093. const wchar_t* in_BusName, ///< Name of the master bus
  4094. const wchar_t* in_DeviceName ///< New device shareset to replace with.
  4095. );
  4096. #endif
  4097. /// Returns a listing of the current devices for a given sink plug-in, including Device ID, friendly name, and state.
  4098. /// This call is only valid for sink plug-ins that support device enumeration.
  4099. /// Prerequisites: the plug-in must have been initialized by loading the init bank or by calling \ref AK::SoundEngine::RegisterPlugin.
  4100. /// \return
  4101. /// - \c AK_NotImplemented if the sink plug-in does not implement device enumeration
  4102. /// - \c AK_PluginNotRegistered if the plug-in has not been registered yet either by loading the init bank or by calling RegisterPluginDLL.
  4103. /// - \c AK_NotCompatible if no device of this type are supported on the current platform
  4104. /// - \c AK_Fail in case of system device manager failure (OS related)
  4105. ///
  4106. AK_EXTERNAPIFUNC(AKRESULT, GetDeviceList) (
  4107. AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
  4108. AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
  4109. AkUInt32& io_maxNumDevices, ///< In: The length of the out_deviceDescriptions array. Out: If out_deviceDescriptions is not-null, this will be set to the number of entries in out_deviceDescriptions that was populated. If out_deviceDescriptions is null, this will be set to the number of devices that may be available.
  4110. AkDeviceDescription* out_deviceDescriptions ///< The output array of device descriptions.
  4111. );
  4112. /// Returns a listing of the current devices for a given sink plug-in, including Device ID, friendly name, and state.
  4113. /// This call is only valid for sink plug-ins that support device enumeration.
  4114. /// Prerequisites:
  4115. /// * The plug-in must have been initialized by loading the init bank or by calling \ref AK::SoundEngine::RegisterPlugin.
  4116. /// * The audio device shareset must have been loaded from a soundbank and a device with this shareset must exist in the pipeline.
  4117. /// \return
  4118. /// AK_NotImplemented if the sink plug-in does not implement device enumeration
  4119. /// AK_PluginNotRegistered if the plug-in has not been registered yet either by loading the init bank or by calling RegisterPluginDLL.
  4120. AK_EXTERNAPIFUNC(AKRESULT, GetDeviceList) (
  4121. AkUniqueID in_audioDeviceShareSetID, ///< In: The audio device shareset ID for which to list the sink plug-in devices.
  4122. AkUInt32& io_maxNumDevices, ///< In: The length of the out_deviceDescriptions array. Out: If out_deviceDescriptions is not-null, this will be set to the number of entries in out_deviceDescriptions that was populated. If out_deviceDescriptions is null, this will be set to the number of devices that may be available.
  4123. AkDeviceDescription* out_deviceDescriptions ///< The output array of device descriptions.
  4124. );
  4125. /// Sets the volume of a output device.
  4126. /// \return
  4127. /// - \c AK_Success if successful
  4128. /// - \c AK_InvalidFloatValue if the value specified was NaN or Inf
  4129. AK_EXTERNAPIFUNC( AKRESULT, SetOutputVolume )(
  4130. AkOutputDeviceID in_idOutput, ///< Output ID to set the volume on. As returned from AddOutput or GetOutputID
  4131. AkReal32 in_fVolume ///< Volume (0.0 = Muted, 1.0 = Volume max)
  4132. );
  4133. /// Returns whether or not the audio device matching the device ID provided supports spatial audio (i.e. the functionality is enabled, and more than 0 dynamic objects are supported).
  4134. /// If Spatial Audio is supported, then you can call Init, AddOutput, or ReplaceOutput with an Audio Device Shareset corresponding to the respective platform-specific plug-in that
  4135. /// provides spatial audio, such as the Microsoft Spatial Sound Platform for Windows. Note that on Xbox One, you need to call EnableSpatialAudio() before the sound engine is
  4136. /// initialized, or initialize the sound engine with AkPlatformInitSettings::bEnableSpatialAudio set to true if you want spatial audio support; otherwise this will always return AK_NotCompatible.
  4137. /// \return
  4138. /// AK_NotCompatible when the device ID provided does not support spatial audio, or the platform does not support spatial audio
  4139. /// AK_Fail when there is some other miscellaneous failure, or the device ID provided does not match a device that the system knows about
  4140. /// AK_Success when the device ID provided does support spatial audio
  4141. AK_EXTERNAPIFUNC( AKRESULT, GetDeviceSpatialAudioSupport ) (
  4142. AkUInt32 in_idDevice ///< Device specific identifier, when multiple devices of the same type are possible. If only one device is possible, leave to 0.
  4143. /// \sa \ref obtaining_device_id
  4144. );
  4145. //@}
  4146. /// This function should be called to put the sound engine in background mode, where audio isn't processed anymore. This needs to be called if the console has a background mode or some suspended state.
  4147. /// Call \c WakeupFromSuspend when your application receives the message from the OS that the process is back in foreground.
  4148. /// When suspended, the sound engine will process API messages (like PostEvent and SetSwitch) only when \ref RenderAudio() is called.
  4149. /// It is recommended to match the <b>in_bRenderAnyway</b> parameter with the behavior of the rest of your game:
  4150. /// if your game still runs in background and you must keep some kind of coherent state between the audio engine and game, then allow rendering.
  4151. /// If you want to minimize CPU when in background, then don't allow rendering and never call RenderAudio from the game.
  4152. ///
  4153. /// Consult \ref workingwithsdks_system_calls to learn when it is appropriate to call this function for each platform.
  4154. /// \sa WakeupFromSuspend
  4155. /// \sa \ref workingwithsdks_system_calls
  4156. AK_EXTERNAPIFUNC( AKRESULT, Suspend )(
  4157. bool in_bRenderAnyway = false, ///< If set to true, audio processing will still occur, but not outputted. When set to false, no audio will be processed at all, even upon reception of RenderAudio().
  4158. bool in_bFadeOut = true ///< Delay the suspend by one audio frame in order to fade-out. When false, the suspend takes effect immediately but audio may glitch.
  4159. );
  4160. /// This function should be called to wake up the sound engine and start processing audio again. This needs to be called if the console has a background mode or some suspended state.
  4161. ///
  4162. /// Consult \ref workingwithsdks_system_calls to learn when it is appropriate to call this function for each platform.
  4163. /// \sa Suspend
  4164. /// \sa \ref workingwithsdks_system_calls
  4165. AK_EXTERNAPIFUNC( AKRESULT, WakeupFromSuspend )(
  4166. AkUInt32 in_uDelayMs = 0 /// Delay (in milliseconds) before the wake up occurs. Rounded up to audio frame granularity. Adding a delay is useful if there is a possibility that another OS event may override the wake-up in the near future.
  4167. );
  4168. /// Obtains the current audio output buffer tick. This corresponds to the number of buffers produced by
  4169. /// the sound engine since initialization.
  4170. /// \return Tick count.
  4171. AK_EXTERNAPIFUNC(AkUInt32, GetBufferTick)();
  4172. /// Obtains the current audio output sample tick. This corresponds to the number of sapmles produced by
  4173. /// the sound engine since initialization.
  4174. /// \return Sample count.
  4175. AK_EXTERNAPIFUNC(AkUInt64, GetSampleTick)();
  4176. }
  4177. }
  4178. #endif // _AK_SOUNDENGINE_H_