// Token: 0x06001C73 RID: 7283 RVA: 0x00079A21 File Offset: 0x00077C21 public StateSetter(string name) { this.name = name; this.id = AkSoundEngine.GetIDFromString(name); this.expectedEngineValueId = 0U; this.valueId = this.expectedEngineValueId; }
public static void ResumeEvent(string eventName, GameObject gameObject, int fadeout) { uint eventID; eventID = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventID, AkActionOnEventType.AkActionOnEventType_Resume, gameObject, fadeout * 1000, AkCurveInterpolation.AkCurveInterpolation_Sine); }
public void ChangeBus(BusName bus, ref AkEnvironment env) { string busName = System.Enum.GetName(typeof(BusName), bus); int id = (int)AkSoundEngine.GetIDFromString(busName); env.SetAuxBusID(id); }
public void StopEvent(string eventName) { uint eventID; eventID = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventID, AkActionOnEventType.AkActionOnEventType_Stop, gameObject, 0, AkCurveInterpolation.AkCurveInterpolation_Sine); }
/// Updates the room effects of the environment with given |room| properties. /// @note This should only be called from the main Unity thread. public static void UpdateAudioRoom(WwiseGvrAudioRoom room, bool roomEnabled) { // Update the enabled rooms list. if (roomEnabled) { if (!enabledRooms.Contains(room)) { enabledRooms.Add(room); } } else { enabledRooms.Remove(room); } // Update the current room effects to be applied. uint roomEffectsBusId = AkSoundEngine.GetIDFromString(roomEffectsBusName); if (enabledRooms.Count > 0) { WwiseGvrAudioRoom currentRoom = enabledRooms[enabledRooms.Count - 1]; RoomProperties roomProperties = GetRoomProperties(currentRoom); // Pass the room properties into a pointer. IntPtr roomPropertiesPtr = Marshal.AllocHGlobal(roomPropertiesSize); Marshal.StructureToPtr(roomProperties, roomPropertiesPtr, false); AkSoundEngine.SendPluginCustomGameData(roomEffectsBusId, AkSoundEngine.AK_MIXER_FX_SLOT, roomPropertiesPtr, (uint)roomPropertiesSize); Marshal.FreeHGlobal(roomPropertiesPtr); } else { // Set the room properties to null, which will effectively disable the room effects. AkSoundEngine.SendPluginCustomGameData(roomEffectsBusId, AkSoundEngine.AK_MIXER_FX_SLOT, IntPtr.Zero, 0U); } }
public void PlayAmbiance() { uint _play_Ambiance = AkSoundEngine.GetIDFromString("Play_Ambiance"); AkSoundEngine.PostEvent(_play_Ambiance, gameObject); StartCoroutine(PlayCommentateurDelayed()); }
// Token: 0x06002711 RID: 10001 RVA: 0x000A9E38 File Offset: 0x000A8038 public static void SetNetworkSoundEvents(List <NetworkSoundEventDef> newEntriesList) { NetworkSoundEventCatalog.eventNameToIndexTable.Clear(); NetworkSoundEventCatalog.eventIdToIndexTable.Clear(); NetworkSoundEventCatalog.entries = newEntriesList.ToArray(); Array.Sort <NetworkSoundEventDef>(NetworkSoundEventCatalog.entries, (NetworkSoundEventDef a, NetworkSoundEventDef b) => StringComparer.OrdinalIgnoreCase.Compare(a.eventName, b.eventName)); for (int i = 0; i < NetworkSoundEventCatalog.entries.Length; i++) { NetworkSoundEventDef networkSoundEventDef = NetworkSoundEventCatalog.entries[i]; networkSoundEventDef.index = (NetworkSoundEventIndex)i; networkSoundEventDef.akId = AkSoundEngine.GetIDFromString(networkSoundEventDef.eventName); if (networkSoundEventDef.akId == 0U) { Debug.LogErrorFormat("Error during network sound registration: Wwise event \"{0}\" does not exist.", new object[] { networkSoundEventDef.eventName }); } } for (int j = 0; j < NetworkSoundEventCatalog.entries.Length; j++) { NetworkSoundEventDef networkSoundEventDef2 = NetworkSoundEventCatalog.entries[j]; NetworkSoundEventCatalog.eventNameToIndexTable[networkSoundEventDef2.eventName] = networkSoundEventDef2.index; NetworkSoundEventCatalog.eventIdToIndexTable[networkSoundEventDef2.akId] = networkSoundEventDef2.index; } }
public void PauseEvent(string eventName, int fadeout) { uint eventId; eventId = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventId, AkActionOnEventType.AkActionOnEventType_Pause, gameObject, fadeout * 1000, AkCurveInterpolation.AkCurveInterpolation_Sine); }
/// <summary> /// Used to resume an audio event. includes a fade in. /// </summary> /// <param name="eventName">Name opf the event to be resumed</param> /// <param name="fadeOut"> Fade in time</param> public void Resume(string eventName, float fadeIn) { uint eventID; eventID = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventID, AkActionOnEventType.AkActionOnEventType_Resume, gameObject, (int)(fadeIn * 1000), AkCurveInterpolation.AkCurveInterpolation_Sine); }
public static void DynamicDialogue(string eventName, string[] args, GameObject go) { // Generated locally, no match in project uint sequenceID = AkSoundEngine.DynamicSequenceOpen(go); // eg. VO_Positives_E uint eventUINT = AkSoundEngine.GetIDFromString(eventName); // build hashes for arguments, eg. Grunt, Cheer, uint[] argUINTS = new uint[args.Length]; for (int i = 0; i < argUINTS.Length; i++) { argUINTS[i] = AkSoundEngine.GetIDFromString(args[i]); } // audio file hash uint nodeID = AkSoundEngine.ResolveDialogueEvent(eventUINT, argUINTS, (uint)argUINTS.Length); // sequence of events being played. AkPlaylist playList = AkSoundEngine.DynamicSequenceLockPlaylist(sequenceID); playList.Enqueue(nodeID); AkSoundEngine.DynamicSequenceUnlockPlaylist(sequenceID); AkSoundEngine.DynamicSequencePlay(sequenceID); AkSoundEngine.DynamicSequenceClose(sequenceID); }
private static void DoActionOnEvent(string eventName, AkActionOnEventType action, int fadeout) { uint eventID = AkSoundEngine.GetIDFromString(eventName); //default curve of event action is log, but can change later AkSoundEngine.ExecuteActionOnEvent(eventID, action, Instance.gameObject, fadeout, AkCurveInterpolation.AkCurveInterpolation_Log1); AkSoundEngine.RenderAudio(); }
// Token: 0x06001C6F RID: 7279 RVA: 0x0007997A File Offset: 0x00077B7A public RtpcSetter(string name, GameObject gameObject = null) { this.name = name; this.id = AkSoundEngine.GetIDFromString(name); this.gameObject = gameObject; this.expectedEngineValue = float.NegativeInfinity; this.value = this.expectedEngineValue; }
internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef networkSoundEventDef = ScriptableObject.CreateInstance <NetworkSoundEventDef>(); networkSoundEventDef.akId = AkSoundEngine.GetIDFromString(eventName); networkSoundEventDef.eventName = eventName; TTGL_SurvivorPlugin.networkSoundEventDefs.Add(networkSoundEventDef); return(networkSoundEventDef); }
public static uint GetConvertedGroupId(this AudioGroupItem audioGroup) { if (audioGroup.ConvertedGroupId == AkSoundEngine.AK_INVALID_UNIQUE_ID) { audioGroup.ConvertedGroupId = AkSoundEngine.GetIDFromString(audioGroup.Group); } return(audioGroup.ConvertedGroupId); }
public static uint GetConvertedId(this AudioEventItem audioEventItem) { if (audioEventItem.ConvertedId == AkSoundEngine.AK_INVALID_UNIQUE_ID) { audioEventItem.ConvertedId = AkSoundEngine.GetIDFromString(audioEventItem.Event); } return(audioEventItem.ConvertedId); }
private static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef networkSoundEventDef = ScriptableObject.CreateInstance <NetworkSoundEventDef>(); networkSoundEventDef.akId = AkSoundEngine.GetIDFromString(eventName); networkSoundEventDef.eventName = eventName; networkSoundEventDef.index = new NetworkSoundEventIndex(); return(networkSoundEventDef); }
void Awake() { //StartMainLoop(); AkSoundEngine.PostEvent(AkSoundEngine.GetIDFromString("main_loop"), gameObject); if (GetComponent <PlayerController>()) { player = GetComponent <PlayerController>(); particles = GetComponentInChildren <ParticleController>(); } }
public static uint GetConvertedGroupStateId(this AudioGroupItem audioGroup, int index) { if (audioGroup.ConvertedStateIds == null) { audioGroup.ConvertedStateIds = new uint[audioGroup.StateArr.Length]; } if (audioGroup.ConvertedStateIds [index] == AkSoundEngine.AK_INVALID_UNIQUE_ID) { audioGroup.ConvertedStateIds [index] = AkSoundEngine.GetIDFromString(audioGroup.StateArr[index]); } return(audioGroup.ConvertedStateIds [index]); }
public void SetEnvironmentBasedOnFloor(int floor) { AkAuxSendArray aEnvs = new AkAuxSendArray(); int floorAuxIndex = floorAuxMap[floor]; for (int i = 0; i < auxCount; i++) { float value = (floorAuxIndex == i) ? 1.0f : 0.0f; auxValues[i] = value; aEnvs.Add(AkSoundEngine.GetIDFromString(floorAux[i]), value); } AkSoundEngine.SetGameObjectAuxSendValues(gameObject, aEnvs, (uint)auxCount); }
public void PauseEvent(string eventName, float fadeout) { uint eventID; eventID = AkSoundEngine.GetIDFromString(eventName); int fadeoutMs = (int)fadeout * 1000; AkSoundEngine.ExecuteActionOnEvent( eventID, AkActionOnEventType.AkActionOnEventType_Pause, gameObject, fadeoutMs, AkCurveInterpolation.AkCurveInterpolation_Sine); }
internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef networkSoundEventDef = ScriptableObject.CreateInstance <NetworkSoundEventDef>(); networkSoundEventDef.akId = AkSoundEngine.GetIDFromString(eventName); networkSoundEventDef.eventName = eventName; NetworkSoundEventCatalog.getSoundEventDefs += delegate(List <NetworkSoundEventDef> list) { list.Add(networkSoundEventDef); }; return(networkSoundEventDef); }
public void IncompleteAction(string eventName, bool complete) { //if bool is true, POST EVENT if (complete == true) { AkSoundEngine.PostEvent(eventName, gameObject); } if (complete == false) { uint eventId; eventId = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventId, AkActionOnEventType.AkActionOnEventType_Stop, gameObject, 0, AkCurveInterpolation.AkCurveInterpolation_Linear); } //if bool is false, STOP EVENT }
public override void Awake() { if (!AkSoundEngine.IsInitialized()) { // // Check to see if the AkInitializer is in the scene // AkInitializer initializer = GameObject.FindObjectOfType <AkInitializer>(); if (initializer == null) { mWwiseAvailable = false; Debug.LogError("Trying to use Wwise NewtonVR collision sounds but no AkInitializer in scene"); return; } Debug.LogWarning("Wwise NewtonVR collision sounds framework awake but Wwise not yet initialised"); } mWwiseAvailable = true; AudioPool = new AkGameObj[NVRCollisionSoundController.Instance.SoundPoolSize]; AudioSourcePrefab = Resources.Load <GameObject>(AudioSourcePrefabPath); for (int index = 0; index < AudioPool.Length; index++) { AudioPool[index] = GameObject.Instantiate <GameObject>(AudioSourcePrefab).GetComponent <AkGameObj>(); AudioPool[index].transform.parent = this.transform; // // Disable the AkGameObjs until they are actually in use // AudioPool[index].gameObject.SetActive(false); } mImpactVolumeControlId = AkSoundEngine.GetIDFromString(kImpactVolumeControlName); }
//public GameObject gameObjectForMusicPlayer; void OnLevelWasLoaded() { int currLevel = Application.loadedLevel; string desiredState; string desiredGameLevel; if (currLevel == 1) //main menu: { desiredGameLevel = "Game_Music"; desiredState = "Music_level2"; } else { desiredGameLevel = "Game_Music"; desiredState = "Music_level1"; } uint stateGroupId = AkSoundEngine.GetIDFromString(desiredGameLevel); uint stateId = AkSoundEngine.GetIDFromString(desiredState); //Debug.Log ("state group id :" + stateGroupId + "stete id :" + stateId); //AkSoundEngine.SetState(stateGroupId,stateId); AkSoundEngine.SetState(desiredGameLevel, desiredState); //Debug.Log ("currLeveL: "+currLevel+" desiredState: "+desiredState); }
public void CopyTo(AkOutputSettings settings) { settings.audioDeviceShareset = string.IsNullOrEmpty(m_AudioDeviceShareset) ? AkSoundEngine.AK_INVALID_UNIQUE_ID : AkSoundEngine.GetIDFromString(m_AudioDeviceShareset); settings.idDevice = m_DeviceID; settings.ePanningRule = (AkPanningRule)m_PanningRule; m_ChannelConfig.CopyTo(settings.channelConfig); }
public void StopAmbiance() { uint _stop_Ambiance = AkSoundEngine.GetIDFromString("Stop_Ambiance"); AkSoundEngine.PostEvent(_stop_Ambiance, gameObject); }
public override void Awake() { base.Awake(); //Cache the ID to avoid repetitive calls to GetIDFromString that will give the same result. m_auxBusID = AkSoundEngine.GetIDFromString(auxBusName); }
public void resumeEvent(string eventName) { uint eventId = AkSoundEngine.GetIDFromString(eventName); AkSoundEngine.ExecuteActionOnEvent(eventId, AkActionOnEventType.AkActionOnEventType_Resume, gameObject, 0, AkCurveInterpolation.AkCurveInterpolation_Sine); }
// Token: 0x06000EB7 RID: 3767 RVA: 0x0004166C File Offset: 0x0003F86C private void UpdateState() { this.stGameplaySongChoice.valueId = CommonWwiseIds.none; this.stMusicSystem.valueId = CommonWwiseIds.none; this.stMusicMenu.valueId = CommonWwiseIds.none; this.stBossStatus.valueId = CommonWwiseIds.none; this.rtpcTeleporterPlayerStatus.value = 1f; SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef; if (mostRecentSceneDef) { string baseSceneName = mostRecentSceneDef.baseSceneName; if (baseSceneName == "title") { this.stMusicSystem.valueId = CommonWwiseIds.menu; this.stMusicMenu.valueId = CommonWwiseIds.main; return; } if (baseSceneName == "lobby") { this.stMusicSystem.valueId = CommonWwiseIds.menu; this.stMusicMenu.valueId = CommonWwiseIds.main; return; } if (baseSceneName == "logbook") { this.stMusicSystem.valueId = CommonWwiseIds.menu; this.stMusicMenu.valueId = CommonWwiseIds.logbook; return; } if (baseSceneName == "crystalworld") { this.stMusicSystem.valueId = CommonWwiseIds.menu; this.stMusicMenu.valueId = CommonWwiseIds.logbook; return; } if (baseSceneName == "bazaar") { this.stMusicSystem.valueId = CommonWwiseIds.secretLevel; return; } this.stMusicSystem.valueId = CommonWwiseIds.gameplay; if (mostRecentSceneDef) { this.stGameplaySongChoice.valueId = AkSoundEngine.GetIDFromString(mostRecentSceneDef.songName); } if (TeleporterInteraction.instance && !TeleporterInteraction.instance.isIdle) { this.stGameplaySongChoice.valueId = AkSoundEngine.GetIDFromString(mostRecentSceneDef.bossSongName); this.stBossStatus.valueId = CommonWwiseIds.alive; this.stMusicSystem.valueId = CommonWwiseIds.bossfight; if (TeleporterInteraction.instance.isIdleToCharging || TeleporterInteraction.instance.isCharging) { if (this.target) { this.rtpcTeleporterPlayerStatus.value = 0f; if (TeleporterInteraction.instance.IsInChargingRange(this.target)) { this.rtpcTeleporterPlayerStatus.value = 1f; return; } } } else if (TeleporterInteraction.instance.isCharged) { this.stBossStatus.valueId = CommonWwiseIds.dead; } } } }
public void postEvent(string event1) { AkSoundEngine.PostEvent(AkSoundEngine.GetIDFromString(event1), gameObjectID); }