void Awake()
 {
     DontDestroyOnLoad(transform.gameObject);
     if (soundMixer == null) soundMixer = Resources.Load("Sounds") as AudioMixer;
     _soundChannels = soundMixer.FindMatchingGroups("Master/");
     _defaultSnapshotWeights = weights;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new OpenALAudioBuffer class.
 /// </summary>
 public OpenALAudioBuffer(OpenALAudioFormat format, OpenALDevice device)
 {
     Format = format;
     Owner = device;
     _locker = new object();
     _audioMixer = new AudioMixer();
     PlaybackState = PlaybackState.Stopped;
     _source = Owner.SourcePool.RequestSource();
 }
Exemplo n.º 3
0
 public OpusEchoCanceller(int clockRate, int channels)
 {
     if (IsSupported)
     {
         AcousticEchoCanceller = new AcousticEchoCanceller(clockRate, channels, 300);
         AudioMixer = new AudioMixer(clockRate, channels, 20);
         AudioMixer.OnFrame += OnAudioMixerFrame;
     }
 }
Exemplo n.º 4
0
    public void UpdateAudioMixer()
    {
        if(audioMixer==null)
        {

            audioMixer = AudioManager.GetAudioMixer();
        }
        audioMixer.SetFloat("masterVolume", masterVolume);
        audioMixer.SetFloat("musicVolume", musicVolume);
        audioMixer.SetFloat("soundsVolume", soundsVolume);
    }
Exemplo n.º 5
0
	void Awake(){
		cameraSettings = FindObjectOfType<Camera2DFollow> ();
		marker1 = Resources.Load<GameObject> ("Markers/Marker1");
		marker2 = Resources.Load<GameObject> ("Markers/Marker2");
		obstacle = Resources.Load<GameObject> ("Markers/Obstacle");
		boom = Resources.Load<AudioClip> ("Audio/Final/Boom");
		preDrop = Resources.Load<AudioClip> ("Audio/Final/Pre-drop");
		audioSource = GetComponentInParent<AudioSource> ();
		player = GameObject.FindWithTag("Player");
		mixer = audioSource.outputAudioMixerGroup.audioMixer;
		beat = FindObjectOfType<BeatMatcher> ();
	}
Exemplo n.º 6
0
    private void SetupPlayer()
    {
        // Create Audio Source
        audioSource = gameObject.AddComponent<AudioSource>();

        // Get audio mixer
        audioMixer = Resources.Load("Audio/Master") as AudioMixer;

        // Find music mixer groups
        AudioMixerGroup[] MusicGroups = audioMixer.FindMatchingGroups("Music");

        // Set audio source mixer group to first index
        audioSource.outputAudioMixerGroup = MusicGroups[0];
    }
	private void Awake() {
		mixer = bass.outputAudioMixerGroup.audioMixer;
		beat = FindObjectOfType<BeatMatcher> ();
		melodies = Resources.LoadAll<AudioClip>("Audio/Final/Teleports");
		notes1 = Resources.LoadAll<AudioClip>("Audio/Final/Layer 1");
		notes2 = Resources.LoadAll<AudioClip>("Audio/Final/Layer 2");
		notes3 = Resources.LoadAll<AudioClip>("Audio/Final/Layer 3");
		notes = new List<AudioClip[]> ();
		notes.Add (notes1);
		notes.Add (notes2);
		notes.Add (notes3);
		rayMask |= 1 << LayerMask.NameToLayer ("Platform");
		teleports = new Dictionary<Note, AudioClip[]> ();
		teleports.Add(Note.i, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/i"));
		teleports.Add(Note.III, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/III"));
		teleports.Add(Note.iv, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/iv"));
		teleports.Add(Note.v, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/v"));
		teleports.Add(Note.VI, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/VI"));
		teleports.Add(Note.VII, Resources.LoadAll<AudioClip>("Audio/Final/Teleports/VII"));
		pulses = new Dictionary<Note, AudioClip[]> ();
		pulses.Add (Note.i, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/C"));
		pulses.Add (Note.III, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/Eb"));
		pulses.Add (Note.iv, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/F"));
		pulses.Add (Note.v, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/G"));
		pulses.Add (Note.VI, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/Ab"));
		pulses.Add (Note.VII, Resources.LoadAll<AudioClip>("Audio/Final/Pulse/Bb"));
		dashes = Resources.LoadAll<AudioClip>("Audio/Final/Dashes");
		bubbleCatch = Resources.Load<AudioClip> ("Audio/Final/Bubble_catch");
		bubbleRelease = Resources.Load<AudioClip>("Audio/Final/Bubble_release");
		crash = Resources.Load<AudioClip> ("Audio/Final/Layer 2 crash");
		noteToMelody = new Dictionary<Note, AudioClip[]> ();
		noteToMelody.Add (Note.i, buildMelodyClipArray (melodies, 2, 3, 6, 7, 9));
		noteToMelody.Add (Note.III, buildMelodyClipArray (melodies, 6, 7, 9, 1));
		noteToMelody.Add (Note.iv, buildMelodyClipArray (melodies, 8,0,2,3));
		noteToMelody.Add (Note.v, buildMelodyClipArray (melodies, 9,1,4,5));
		noteToMelody.Add (Note.VI, buildMelodyClipArray (melodies, 0,2,3,6,7));
		noteToMelody.Add (Note.VII, buildMelodyClipArray (melodies, 1,4,5,8));
		noteToDashMelody = new Dictionary<Note, AudioClip[]> ();
		noteToDashMelody.Add (Note.i, buildMelodyClipArray (dashes, 2, 3, 6, 7, 9));
		noteToDashMelody.Add (Note.III, buildMelodyClipArray (dashes, 6, 7, 9, 1));
		noteToDashMelody.Add (Note.iv, buildMelodyClipArray (dashes,8,0,2,3));
		noteToDashMelody.Add (Note.v, buildMelodyClipArray (dashes,9,1,4,5));
		noteToDashMelody.Add (Note.VI, buildMelodyClipArray (dashes,0,2,3,6,7));
		noteToDashMelody.Add (Note.VII, buildMelodyClipArray (dashes,1,4,5,8));
	}
	void Awake () 
    {
        DontDestroyOnLoad(transform.gameObject);    //in case this is in diff GameObject as SoundMaster
        
        /* //If Music Players are not children of MusicManager, uncomment this
        for (int i = 0; i < musicPlayers.Length; i++ )
        {
            DontDestroyOnLoad(musicPlayers[i].transform.gameObject);
        }*/

        if (MusicMixer == null) MusicMixer = Resources.Load("Music") as AudioMixer;
        _musicChannels = MusicMixer.FindMatchingGroups("Master/");
        defaultSnapshotWeights = weights;

        if (musicPlayers[0].outputAudioMixerGroup == null)
        {
            Debug.Log("Default Music Player have no audiomixergroups attached, attaching one automatically. " + 
                "If you have other music players active, attach them to their respective audiogroups.");    
            musicPlayers[0].outputAudioMixerGroup = _musicChannels[0];
        }
	}
Exemplo n.º 9
0
 /// <summary>
 /// Plays forward all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens played.
 /// </summary>
 public static int DOPlayForward(this AudioMixer target)
 {
     return(DG.Tweening.DOTween.PlayForward(target));
 }
 internal void SetInputToAudioPlugin(AudioMixer targetAudioMixer, string exposedRendererIDParameterName)
 {
     input = Input.AudioPlugin;
     this.targetAudioMixer = targetAudioMixer;
     this.exposedRendererIDParameterName = exposedRendererIDParameterName;
 }
Exemplo n.º 11
0
 // Fades in a mixer instead of an audio source. The same principle as above.
 public Coroutine FadeIn(AudioMixer audio, string parameter, float fadeTime, float volume = 0.0f)
 {
     return(StartCoroutine(Fade_(audio, parameter, fadeTime, volume)));
 }
Exemplo n.º 12
0
 private void AjusterVolume(AudioMixer audioSource, string valueName, Slider curseur, int valeurMin = -24, int valeurMax = 0)
 {
     audioSource.SetFloat (valueName, _StaticFunction.MappingScale(curseur.value, curseur.minValue, curseur.maxValue, valeurMin, valeurMax));
 }
Exemplo n.º 13
0
 private static extern void Internal_CreateAudioMixerSnapshotController([Writable] AudioMixerSnapshotController mono, AudioMixer owner);
Exemplo n.º 14
0
 public static void SetVolume( AudioMixer mixer, string nameVolume, float valueVolume)
 {
     mixer.SetFloat (nameVolume, valueVolume);
 }
Exemplo n.º 15
0
    //!callback function, builds audio source once a clip is loaded
    void finishedLoading(AudioClip clip, AudioMixer mixerGroup, GameObject go, string name, string loadType)
    {
        AudioSource source = go.AddComponent<AudioSource>();

        AudioMixerGroup[] groupArray = mixerGroup.FindMatchingGroups(name);
        Debug.Log("audio", "FinishedLoading: group array length is " + groupArray.Length);

        if (groupArray.Length == 1){
            source.outputAudioMixerGroup = groupArray[0];           //how i set the output for the source's mixergroup
            source.clip = clip;

            source.Play();
            //Add to active audio dictionary
            activeAudio.Add(name, source);

            Debug.Log("audio", "FinishedLoading: source name is " + name + " and has been added to active audio");
            Debug.Log("audio", "FinishedLoading: clip length is " + source.clip.length);

            //start a new coroutine to wait for DESTRUCTION TIME
            StartCoroutine(reclaimSource(source, name, loadType));
        }else if (groupArray.Length > 1){
            Debug.Warning("audio", "FinishedLoading: more than 1 mixer group exists for the sound " + name);
        }else{
            Debug.Warning("audio", "FinishedLoading: No mixer group exists for sound " + name);
        }
    }
Exemplo n.º 16
0
    /// <summary>
    /// 플레이어 새로 설정
    /// </summary>
    void InitPlayer()
    {
        // Mixer 컨트롤러 초기화

        var mixer_layers	= new AudioMixer[][] { m_mixers_deckA_section1, m_mixers_deckA_section2, m_mixers_deckB_section1, m_mixers_deckB_section2 };
        var mixer_decks		= new AudioMixer[][] { m_mixers_deckA, m_mixers_deckB };

        for (int deck = 0; deck < 2; deck++ )
        {
            m_automationMgr.AddAutomationControlToMixer(GetMixerName(deck), m_mixers_decks[deck]);

            var mdeckarr	= mixer_decks[deck];
            for (int section = 0; section < 2; section++)
            {
                m_automationMgr.AddAutomationControlToMixer(GetMixerName(deck, section), mdeckarr[section], true);

                var mlayerarr	= mixer_layers[section + (deck * 2)];
                for (int layer = 0; layer < 4; layer++)
                {
                    m_automationMgr.AddAutomationControlToMixer(GetMixerName(deck, section, layer), mlayerarr[layer], true);
                }
            }
        }

        // 플레이어 생성
        var tplayer1		= CreateTrackPlayer(0, m_mixers_deckA_section1, m_mixers_deckA_section2);
        var tplayer2		= CreateTrackPlayer(1, m_mixers_deckB_section1, m_mixers_deckB_section2);

        m_masterplayer		= new MasterPlayer(this);
        m_masterplayer.SetTrackPlayers(tplayer1, tplayer2);
        var deckActrl		= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(0));
        var deckBctrl		= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(1));
        m_masterplayer.SetTransitionCtrls(deckActrl, deckBctrl);
    }
Exemplo n.º 17
0
    TrackPlayer CreateTrackPlayer(int deck, AudioMixer[] section1Mixers, AudioMixer[] section2Mixers)
    {
        // 텐션 오토메이션 버스 생성
        AutomationHub [] tensionCtrlBus			= new AutomationHub[4];
        IAutomationControl [] sec1TensionCtrls	= new IAutomationControl[4];
        IAutomationControl [] sec2TensionCtrls	= new IAutomationControl[4];
        for (int i = 0; i < 4; i++)
        {
            var out1	= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(deck, 0, i));
            var out2	= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(deck, 1, i));

            var bus		= new AutomationHub(m_automationMgr);
            bus.SetOutputs(out1, out2);
            bus.CreateChains(2);

            tensionCtrlBus[i]	= bus;

            sec1TensionCtrls[i]	= tensionCtrlBus[i].GetChain(0);
            sec2TensionCtrls[i]	= tensionCtrlBus[i].GetChain(1);
        }

        // 플레이어 생성
        var tplayer			= new TrackPlayer(this);

        var player1ctrl		= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(deck, 0));
        var player1			= CreateSectionPlayer(section1Mixers, player1ctrl, sec1TensionCtrls);
        tplayer.AttachSectionPlayer(player1, player1ctrl);

        var player2ctrl		= m_automationMgr.GetAutomationControlToSingleMixer(GetMixerName(deck, 1));
        var player2			= CreateSectionPlayer(section2Mixers, player2ctrl, sec2TensionCtrls);
        tplayer.AttachSectionPlayer(player2, player2ctrl);

        return tplayer;
    }
	float Mixer_Get_Float(AudioMixer Mixer, string param){
		float temp;
		Mixer.GetFloat (MIXER_BGM_VOLUME, out temp);
		temp = Mathf.InverseLerp (MIXER_MIN_VOLUME, MIXER_MAX_VOLUME, temp);
		return temp;
	}
	/****** Volume ******/ 
	void Mixer_Set_Float(AudioMixer Mixer, string param, float value){
		//float volume = Mathf.Clamp(value, 0.0001f, 1.0f);
		//float volumeDB = 20f * Mathf.Log10(volume);
		//Mixer.SetFloat (param, Mathf.Clamp(volumeDB, -80.0f, 0.0f));
		Mixer.SetFloat (param, Mathf.Lerp(MIXER_MIN_VOLUME, MIXER_MAX_VOLUME, value));
	}
Exemplo n.º 20
0
    // Used to find the AudioMixerObject
    private static void FindAMObject()
    {
        GameObject foundMixerObject = null;
        AudioMixer mixerComponent = null;

        if(!instanceFound)
        {
            //Debug.Log("Finding Mixer");
            foundMixerObject = GameObject.Find("AudioMixerObject");
            if(foundMixerObject == null)
            {
                //Debug.Log("Mixer not found. Making one.");
                // Change this path if you move AudioMixerObject.prefab somewhere else.
                // AudioMixerObject.prefab must be in a folder called "Resources" or this won't work.
                foundMixerObject = Instantiate( Resources.Load("AudioMixerObject") ) as GameObject;
                mixerComponent = foundMixerObject.GetComponent<AudioMixer>();
                mixerComponent.Start();
            }
            else
            {
                //Debug.Log("Mixer Found!");
                mixerComponent = foundMixerObject.GetComponent<AudioMixer>();
            }
            AudioMixer.theInstance = mixerComponent;
            instanceFound = true;
        }
        else
        {
            //Debug.Log("Mixer already found");
        }
    }
Exemplo n.º 21
0
 private void MuteSound(AudioMixer audiosource, string valueName)
 {
     audiosource.SetFloat (valueName, -80);
 }
Exemplo n.º 22
0
 /// <summary>
 /// Smoothly rewinds all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens rewinded.
 /// </summary>
 public static int DOSmoothRewind(this AudioMixer target)
 {
     return(DG.Tweening.DOTween.SmoothRewind(target));
 }
Exemplo n.º 23
0
 public static void Initialize()
 {
     mainMixer = Resources.Load("AudioMixers/MainMixer") as AudioMixer;
     SetSnapshot("MainSnap", 0);
     Debug.Log("Audio Mixer initialized: " + mainMixer.name + "\nCurrent Snapshot: " + currentSnapshot.name);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Completes all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens completed
 /// (meaning the tweens that don't have infinite loops and were not already complete)
 /// </summary>
 /// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
 /// otherwise they will be ignored</param>
 public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
 {
     return(DG.Tweening.DOTween.Complete(target, withCallbacks));
 }
Exemplo n.º 25
0
 public void Awake()
 {
     ambience = (PlayMakerFSM.FindFsmOnGameObject(GameObject.Find("SATSUMA(557kg, 248)/PlayerTrigger"), "PlayerTrigger").FsmStates[0].Actions[0] as HutongGames.PlayMaker.Actions.AudioMixerSetFloatValue).theMixer.Value as AudioMixer;
 }
 // --- ミキサーからミキサーグループの抽出 ---
 static void CreateMixerGroup(AudioMixer mixer)
 {
     foreach (var group in mixer.FindMatchingGroups(""))
     {
         string replacedName = ReplaceString(group.name);
         audioData.RegisterGroup(replacedName, group);
         if (!groupFileList.Contains(group))
             groupFileList.Add(group);
     }
 }
Exemplo n.º 27
0
    /**
     * @brief Sets the audio data for this object
     * @param[in] aAudioData The raw audio data for each @link DefBID Built-In Dynamic@endlink if supported by the instrument. It is just the raw audio data for a single @link Music::PITCH@endlink otherwise.
     * @param[in] aMixer The audio mixer to route the audio output to.
     * @param[in] aThresholds The @link DefBIDThresh Built-In Dynamics thresholds@endlink if supported by the instrument. Default is null for instruments that don't support @link DefBID Built-In Dynamics@endlink.
     */
    public void SetAudioData(float[][] aAudioData, AudioMixer aMixer, int[] aThresholds = null)
    {
        mLoaded = false;

        while (mAudioDataBeingUsed)
        {
            ;
        }

        // Remove any existing audio data.
        RemoveAudioData();

        // Set the values related to built-in dynamics if necessary.
        if (aThresholds != null)
        {
            mNumBuiltInDynamics        = aThresholds.Length;
            mBuiltInDynamicsThresholds = new int[mNumBuiltInDynamics];
            for (int i = 0; i < aThresholds.Length; i++)
            {
                mBuiltInDynamicsThresholds[i] = aThresholds[i];
            }
        }
        else
        {
            mBuiltInDynamicsThresholds = null;
            mDynamicsIndex             = 0;
            mNumBuiltInDynamics        = 0;
            mCounter = 0;
        }

        // Set the output mixer.
        mSource.outputAudioMixerGroup = aMixer.FindMatchingGroups("Master")[0];

        // Initialize the audio data array and copy the values from the given parameter.
        // If we don't have to worry about built in dynamics, then use hard-coded indices
        // for the outer array.
        if (mNumBuiltInDynamics == 0)
        {
            mAudioData           = new float[1][];
            mAudioData[0]        = new float[aAudioData[0].Length];
            mEndSampleIndices    = new int[1];
            mEndSampleIndices[0] = aAudioData[0].Length - 1;
            for (int i = 0; i < aAudioData[0].Length; i++)
            {
                mAudioData[0][i] = aAudioData[0][i];
            }
        }
        // If there are built in dynamics, then iterate through each one.
        else
        {
            mAudioData        = new float[mNumBuiltInDynamics][];
            mEndSampleIndices = new int[mNumBuiltInDynamics];
            // int bufferLength = 0;
            for (int i = 0; i < mNumBuiltInDynamics; i++)
            {
                mAudioData[i]        = new float[aAudioData[i].Length];
                mEndSampleIndices[i] = aAudioData[i].Length - 1;
                for (int j = 0; j < mAudioData[i].Length; j++)
                {
                    mAudioData[i][j] = aAudioData[i][j];
                }
            }
        }

        // Mark that this object is loaded.
        mLoaded = true;
    }
Exemplo n.º 28
0
 public AudioMixerSnapshotController(AudioMixer owner)
 {
     Internal_CreateAudioMixerSnapshotController(this, owner);
 }
Exemplo n.º 29
0
 public void SetAudioMixer(AudioMixer audioMixer)
 {
     _audioMixer = audioMixer;
 }
Exemplo n.º 30
0
 void InitMainMixerReference()
 {
     mainMixer = Resources.Load <AudioMixer>(mainMixerAssetName);
     GoToSnapshot("default", 0f); // this is the default snapshot
 }
Exemplo n.º 31
0
    // Destroy event
    void OnDestroy()
    {
        // Unassign the instance
        theInstance = null;
        instanceFound = false;
        alreadyRanStart = false;

        // Destroy the channels
        for(int i=0; i<NUM_OF_CHANNELS; i++)
        {
            Destroy(channels[i]);
        }
    }
Exemplo n.º 32
0
 public void Init(AudioMixer mixer)
 {
 }
Exemplo n.º 33
0
 /// <summary>
 /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens flipped.
 /// </summary>
 public static int DOFlip(this AudioMixer target)
 {
     return(DOTween.Flip(target));
 }
Exemplo n.º 34
0
 internal void SetCurrentMaster(AudioMixer master)
 {
     _master = master;
 }
Exemplo n.º 35
0
 /// <summary>
 /// Pauses all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens paused.
 /// </summary>
 public static int DOPause(this AudioMixer target)
 {
     return(DOTween.Pause(target));
 }
Exemplo n.º 36
0
 public static void SearchFor(AudioMixer bus)
 {
     //TODO Update for audio mixer
     EditorApplication.ExecuteMenuItem("Window/Audio Mixer");
 }
Exemplo n.º 37
0
 /// <summary>
 /// Plays backwards all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens played.
 /// </summary>
 public static int DOPlayBackwards(this AudioMixer target)
 {
     return(DOTween.PlayBackwards(target));
 }
Exemplo n.º 38
0
 // Same thing with the mixer.
 public void SetVolume(AudioMixer audio, string parameter, float volume)
 {
     audio.SetFloat(parameter, Mathf.Clamp(volume, lowestMixerVolume, highestMixerVolume));
 }
Exemplo n.º 39
0
 /// <summary>
 /// Rewinds all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens rewinded.
 /// </summary>
 public static int DORewind(this AudioMixer target)
 {
     return(DOTween.Rewind(target));
 }
Exemplo n.º 40
0
 // Fades out a mixer instead of an audio source. Same principle as above, just using the GetFloat and SetFloat
 // to deal with the way the mixer works in unity.
 public Coroutine FadeOut(AudioMixer audio, string parameter, float fadeTime, float volume = lowestMixerVolume)
 {
     return(StartCoroutine(Fade_(audio, parameter, fadeTime, volume)));
 }
Exemplo n.º 41
0
 /// <summary>
 /// Kills all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens killed.
 /// </summary>
 /// <param name="complete">If TRUE completes the tween before killing it</param>
 public static int DOKill(this AudioMixer target, bool complete = false)
 {
     return(DOTween.Kill(target, complete));
 }
Exemplo n.º 42
0
 /// <summary>
 /// Sends to the given position all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens involved.
 /// </summary>
 /// <param name="to">Time position to reach
 /// (if higher than the whole tween duration the tween will simply reach its end)</param>
 /// <param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
 public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
 {
     return(DG.Tweening.DOTween.Goto(target, to, andPlay));
 }
Exemplo n.º 43
0
 public AudioMixerGroupController(AudioMixer owner)
 {
     AudioMixerGroupController.Internal_CreateAudioMixerGroupController(this, owner);
 }
Exemplo n.º 44
0
 /// <summary>
 /// Restarts all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens restarted.
 /// </summary>
 public static int DORestart(this AudioMixer target)
 {
     return(DG.Tweening.DOTween.Restart(target));
 }
Exemplo n.º 45
0
 private static extern void Internal_CreateAudioMixerGroupController(AudioMixerGroupController mono, AudioMixer owner);
Exemplo n.º 46
0
 /// <summary>
 /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
 /// (meaning tweens that were started from this target, or that had this target added as an Id)
 /// and returns the total number of tweens involved.
 /// </summary>
 public static int DOTogglePause(this AudioMixer target)
 {
     return(DG.Tweening.DOTween.TogglePause(target));
 }
Exemplo n.º 47
0
 public void PlayGrain(AudioClip clip, float start, float length, AudioMixer mixer, string group)
 {
     players[playID].Play(clip, start, length, mixer, group);
     Next();
 }
Exemplo n.º 48
0
 /// <summary>
 /// Initializes a new WaveOut class.
 /// </summary>
 public WaveOut()
 {
     _callback = Callback;
     AudioMixer = new AudioMixer();
 }
	public void AddAutomationControlToMixer(string ctrlname, AudioMixer mixer, bool simpleCtrl = false)
	{
		var mixerctrl				= new AudioMixerAutomationControl(mixer);
		m_mixerControls[ctrlname]	= mixerctrl;

		if(simpleCtrl)				// 단순화하는 경우 일부 파라미터를 조정하지 못하도록 지정한다.
		{
			mixerctrl.AddParamToIgnore(Automation.TargetParam.LowCut);
		}
	}
Exemplo n.º 50
0
        public void Play(AudioClip clip, float pitch, float volume, float location, float length, AudioMixer mixer, string group)
        {
            sources[playID].volume = volume;
            sources[playID].pitch  = pitch;
            sources[playID].time   = location;
            sources[playID].outputAudioMixerGroup = mixer.FindMatchingGroups(group)[0];

            Play(clip);

            sources[oPlayID].SetScheduledEndTime(AudioSettings.dspTime + length);
        }
Exemplo n.º 51
0
 /**---------------------------------------------------------------------------------
  * Initiates audioholder, snapshots, sounds and mixers.
  * Is used when first audio is called.
  */
 private void initAudio()
 {
     GameObject audioHolder = Instantiate(Resources.Load("AudioHolder", typeof(GameObject))) as GameObject;
     DontDestroyOnLoad(audioHolder);
     AudioSource[] audioSources = audioHolder.GetComponents<AudioSource>();
     loopSound = audioSources[0];
     jumpSound = audioSources[1];
     slideSound = audioSources[2];
     collisionSound = audioSources[3];
     fallingSound = audioSources[4];
     winSound = audioSources[5];
     MasterMixer = Resources.Load<AudioMixer>("Audio/MasterMixer");
     paused = MasterMixer.FindSnapshot("Paused");
     unPaused = MasterMixer.FindSnapshot("Unpaused");
 }
		public AudioMixerAutomationControl(AudioMixer mixer)
		{
			m_mixer	= mixer;
		}
Exemplo n.º 53
0
    public void MakeLink(GameObject connectTo, WaveSource waveSource, AudioLink origin)
    {
        if (this.gameObject.GetComponent <WaveGenerator>() != null)
        {
            gen   = this.gameObject.GetComponent <WaveGenerator>();
            genGO = this.gameObject;
            //Debug.Log("Adding from WaveGenerator\n" + this.gameObject.GetComponent<WaveGenerator>().waveGO);

            GameObject waveform = Instantiate(this.gameObject.GetComponent <WaveGenerator>().waveGO, this.transform);
            waveform.GetComponent <AudioPathTrack>().addStep(this.gameObject);
            waveform.GetComponent <changeWave>().KillListen(this.gameObject.GetComponent <WaveGenerator>());
            waveform.GetComponent <changeWave>().origionalSpawn = this;
            //Debug.Log(waveform);
            players.Add(waveform);
        }
        else if (this.gameObject.GetComponent <AudioMixer>() != null)
        {
            // Debug.Log("Adding from AudioMixer\n" + this.gameObject.GetComponent<AudioMixer>().players);
            gen     = this.gameObject.GetComponent <AudioMixer>();
            genGO   = this.gameObject;
            players = this.gameObject.GetComponent <AudioMixer>().players;
            foreach (GameObject pl in players)
            {
                pl.GetComponent <AudioPathTrack>().addStep(genGO);
            }
        }
        else if (this.gameObject.GetComponent <HighPass>() != null)
        {
            gen   = this.gameObject.GetComponent <HighPass>();
            genGO = this.gameObject;

            players = this.gameObject.GetComponent <HighPass>().players;
            foreach (GameObject pl in players)
            {
                pl.GetComponent <AudioPathTrack>().addStep(genGO);
            }
        }
        else if (this.gameObject.GetComponent <LowPass>() != null)
        {
            gen   = this.gameObject.GetComponent <LowPass>();
            genGO = this.gameObject;

            players = this.gameObject.GetComponent <LowPass>().players;
            foreach (GameObject pl in players)
            {
                pl.GetComponent <AudioPathTrack>().addStep(genGO);
            }
        }

        connected = connectTo;
        if (connected.GetComponent <AudioOut>() != null)
        {
            //Debug.Log("Players has " + players.Count + " GameObjects");
            for (int i = 0; i < players.Count; ++i)
            {
                players[i].GetComponent <changeWave>().listenFreq(players[i].GetComponent <changeWave>().origionalSpawn);
                players[i].GetComponent <AudioSource>().Play();
            }
        }
        else if (connected.GetComponent <AudioMixer>() != null)
        {
            //Debug.Log("Players has " + players.Count + " GameObjects");
            AudioMixer dest = connected.GetComponent <AudioMixer>();
            dest.NewConnection(gen, players);
        }
        else if (connected.GetComponent <HighPass>())
        {
            connected.GetComponent <HighPass>().NewConnection(gen, players);
        }
        else if (connected.GetComponent <LowPass>())
        {
            connected.GetComponent <LowPass>().NewConnection(gen, players);
        }
        foreach (GameObject p in players)
        {
            p.transform.parent        = connectTo.transform;
            p.transform.localPosition = Vector3.zero;
        }
        if (connected.GetComponent <AudioLink>() != null)
        {
            connected.GetComponent <AudioLink>().updateLink.Invoke(origin);
        }
        connecting.Invoke(connectTo, waveSource);
        dist = Vector3.Distance(this.gameObject.transform.position, connected.transform.position);
    }