protected virtual string GetPlatformAppLocationPath(string AppDir) { string path = Path.Combine(AppDir, AppBaseName + appExtension); AkBankPath.ConvertToPosixPath(ref path); return(path); }
public override void Bind(Entity entity, Main main, bool creating = false) { Transform transform = entity.GetOrCreate <Transform>("Transform"); SoundBank bank = entity.GetOrCreate <SoundBank>("SoundBank"); this.SetMain(entity, main); entity.Add("Name", bank.Name, new PropertyEntry.EditorData { Options = FileFilter.Get(main, AkBankPath.GetPlatformBasePath(), null, SoundBank.Extension) }); }
void Awake() { if (ms_Instance != null) { return; //Don't init twice } #if UNITY_ANDROID InitalizeAndroidSoundBankIO(); #endif Debug.Log("WwiseUnity: Initialize sound engine ..."); //Use default properties for most SoundEngine subsystem. //The game programmer should modify these when needed. See the Wwise SDK documentation for the initialization. //These settings may very well change for each target platform. AkMemSettings memSettings = new AkMemSettings(); memSettings.uMaxNumPools = 20; AkDeviceSettings deviceSettings = new AkDeviceSettings(); AkSoundEngine.GetDefaultDeviceSettings(deviceSettings); AkStreamMgrSettings streamingSettings = new AkStreamMgrSettings(); streamingSettings.uMemorySize = (uint)streamingPoolSize * 1024; AkInitSettings initSettings = new AkInitSettings(); AkSoundEngine.GetDefaultInitSettings(initSettings); initSettings.uDefaultPoolSize = (uint)defaultPoolSize * 1024; AkPlatformInitSettings platformSettings = new AkPlatformInitSettings(); AkSoundEngine.GetDefaultPlatformInitSettings(platformSettings); platformSettings.uLEngineDefaultPoolSize = (uint)lowerPoolSize * 1024; platformSettings.fLEngineDefaultPoolRatioThreshold = memoryCutoffThreshold; #if UNITY_IOS && !UNITY_EDITOR platformSettings.bAppListensToInterruption = true; #endif // #if UNITY_IOS && !UNITY_EDITOR AkMusicSettings musicSettings = new AkMusicSettings(); AkSoundEngine.GetDefaultMusicSettings(musicSettings); AKRESULT result = AkSoundEngine.Init(memSettings, streamingSettings, deviceSettings, initSettings, platformSettings, musicSettings); if (result != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed to initialize the sound engine. Abort."); return; //AkSoundEngine.Init should have logged more details. } AkBankPath.UsePlatformSpecificPath(); string platformBasePath = AkBankPath.GetPlatformBasePath(); // Note: Android low-level IO uses relative path to "assets" folder of the apk as SoundBank folder. // Unity uses full paths for general path checks. We thus don't use DirectoryInfo.Exists to test // our SoundBank folder for Android. #if !UNITY_ANDROID && !UNITY_METRO if (!AkBankPath.Exists(platformBasePath)) { string errorMsg = string.Format("WwiseUnity: Failed to find soundbank folder: {0}. Abort.", platformBasePath); Debug.LogError(errorMsg); return; } #endif // #if !UNITY_ANDROID AkSoundEngine.SetBasePath(platformBasePath); AkSoundEngine.SetCurrentLanguage(language); result = AkCallbackManager.Init(); if (result != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed to initialize Callback Manager. Terminate sound engine."); AkSoundEngine.Term(); return; } AkCallbackManager.SetMonitoringCallback(ErrorLevel.ErrorLevel_All, null); Debug.Log("WwiseUnity: Sound engine initialized."); //The sound engine should not be destroyed once it is initialized. DontDestroyOnLoad(this); ms_Instance = this; //Load the init bank right away. Errors will be logged automatically. uint BankID; result = AkSoundEngine.LoadBank("Init.bnk", AkSoundEngine.AK_DEFAULT_POOL_ID, out BankID); if (result != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed load Init.bnk with result: " + result.ToString()); } }
public static AKRESULT LoadLocalizedBank(string in_bankFilename) { string bankPath = Path.Combine(Path.Combine(AkBankPath.GetPlatformBasePath(), AkGlobalSoundEngineInitializer.GetCurrentLanguage()), in_bankFilename); return(DoLoadBank(bankPath)); }
public static AKRESULT LoadNonLocalizedBank(string in_bankFilename) { string bankPath = Path.Combine(AkBankPath.GetPlatformBasePath(), in_bankFilename); return(DoLoadBank(bankPath)); }
public static string GetLocalizedBankPath(string filename) { return(Path.Combine(Path.Combine(AkBankPath.GetPlatformBasePath(), AkGlobalSoundEngineInitializer.GetCurrentLanguage()), filename)); }
public static string GetNonLocalizedBankPath(string filename) { return(Path.Combine(AkBankPath.GetPlatformBasePath(), filename)); }