public void InitFilterApplier() { //musimy zainicjalizowac tutaj, po rozpoczeciu odgrywania dzwieku w channelGroupie //inaczej blad description = new FMOD.DSP_DESCRIPTION(); description.read = myDSPCallback; FMODUnity.RuntimeManager.LowlevelSystem.createDSP(ref description, out DSPfilter); DSPfilter.setBypass(false); FMOD.RESULT r = musicCube.getChannelGroupForInstrument1().addDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, DSPfilter); UnityEngine.Debug.Log(r); Channel c; musicCube.getChannelGroupForInstrument1().getChannel(0, out c); c.getFrequency(out currentSampleRate); description2 = new FMOD.DSP_DESCRIPTION(); description2.read = myDSPCallback2; FMODUnity.RuntimeManager.LowlevelSystem.createDSP(ref description2, out DSPfilter2); DSPfilter2.setBypass(false); FMOD.RESULT r2 = musicCube.getChannelGroupForInstrument2().addDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, DSPfilter2); UnityEngine.Debug.Log(r2); Channel c2; musicCube.getChannelGroupForInstrument2().getChannel(0, out c2); c2.getFrequency(out currentSampleRate); }
// Use this for initialization void Start() { EarmuffsOn = false; earmuffModel.SetActive(false); coefficientsInitialized = false; description = new FMOD.DSP_DESCRIPTION(); description.read = DSPCallback; FMODUnity.RuntimeManager.LowlevelSystem.createDSP(ref description, out DSPfilter); DSPfilter.setBypass(true); FMOD.ChannelGroup channelgroup; FMODUnity.RuntimeManager.LowlevelSystem.getMasterChannelGroup(out channelgroup); FMOD.RESULT result = channelgroup.addDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, DSPfilter); Debug.Log("Adding earmuffs DSP: " + result); FMOD.SPEAKERMODE speakerMode; int numrawspeakers; FMODUnity.RuntimeManager.LowlevelSystem.getSoftwareFormat(out sampleRate, out speakerMode, out numrawspeakers); }