当前位置: 首页>>代码示例>>C#>>正文


C# FMOD类代码示例

本文整理汇总了C#中FMOD的典型用法代码示例。如果您正苦于以下问题:C# FMOD类的具体用法?C# FMOD怎么用?C# FMOD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FMOD类属于命名空间,在下文中一共展示了FMOD类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EqualizerBand

        private EqualizerBand(FMOD.System system, DSP dspParamEq, float centerValue, float gainValue, bool active)
        {
            this.fmodSystem = system;
            this.dspEQ = dspParamEq;

            if (centerValue >= 1000)
            {
                this.BandCaption = string.Format("{0}K", (centerValue / 1000));
            }
            else
            {
                this.BandCaption = centerValue.ToString(CultureInfo.InvariantCulture);
            }

            this.WhenAnyValue(x => x.Gain)
                .Subscribe(newGain => {
                    if (this.IsActive && this.dspEQ != null)
                    {
                        System.Diagnostics.Debug.WriteLine(">> Gain value: " + newGain);

                        this.dspEQ.setActive(false).ERRCHECK();
                        this.dspEQ.setParameterFloat((int)FMOD.DSP_PARAMEQ.GAIN, newGain).ERRCHECK();
                        this.dspEQ.setActive(true).ERRCHECK();
                        this.fmodSystem.update().ERRCHECK();
                    }
                });

            this.Gain = gainValue;
            this.IsActive = active;
        }
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:30,代码来源:EqualizerBand.cs

示例2: READCALLBACK

        /// <summary>
        /// Readcallback
        /// </summary>
        /// <param name="dsp_state"></param>
        /// <param name="inbuf"></param>
        /// <param name="outbuf"></param>
        /// <param name="length"></param>
        /// <param name="inchannels"></param>
        /// <param name="outchannels"></param>
        /// <returns></returns>
        private static FMOD.RESULT READCALLBACK(ref FMOD.DSP_STATE dsp_state, IntPtr inbuf, IntPtr outbuf, uint length, int inchannels, int outchannels)
        {
            uint count = 0;
            int count2 = 0;
            IntPtr thisdspraw = dsp_state.instance;

            thisdsp.setRaw(thisdspraw);

            unsafe
            {
                float* inbuffer = (float*)inbuf.ToPointer();
                float* outbuffer = (float*)outbuf.ToPointer();

                for (count = 0; count < length; count++)
                {
                    for (count2 = 0; count2 < outchannels; count2++)
                    {
                        outbuffer[(count * outchannels) + count2] = inbuffer[(count * inchannels) + count2];
                    }
                    bpm.AddSample(inbuffer[(count * inchannels)] * 32767.0f);
                }
            }

            return FMOD.RESULT.OK;
        }
开发者ID:olbers,项目名称:sauip4,代码行数:35,代码来源:PlayListBuilder.cs

示例3: SoundGroup

        public SoundGroup(FMOD.SoundGroup fmodSoundGroup)
        {
            if (fmodSoundGroup == null)
                throw new ArgumentNullException("fmodSoundGroup");

            _fmodGroup = fmodSoundGroup;
        }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:7,代码来源:SoundGroup.cs

示例4: System

        public System(FMOD.Studio.System system)
        {
            //Load native dependencies
            Native.Load();

            _system = system;
        }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:7,代码来源:System.cs

示例5: Equalizer

 private Equalizer(FMOD.System system, SMPSettings settings) {
   this.smpSettings = settings;
   this.Name = "DefaultEqualizer";
   this.fmodSystem = system;
   this.Bands = new ObservableCollection<EqualizerBand>();
   this.isEnabled = settings.PlayerSettings.EqualizerSettings == null || settings.PlayerSettings.EqualizerSettings.IsEnabled;
 }
开发者ID:phaufe,项目名称:simple-music-player,代码行数:7,代码来源:Equalizer.cs

示例6: Init

        private void Init(FMOD.System system, bool setToDefaultValues = false)
        {
            system.lockDSP().ERRCHECK();

            this.Bands.Clear();
            var gainValues = !setToDefaultValues && this.playerSettings.PlayerEngine.EqualizerSettings != null
                ? this.playerSettings.PlayerEngine.EqualizerSettings.GainValues
                : null;
            foreach (var value in EqDefaultValues)
            {
                var band = EqualizerBand.GetEqualizerBand(system, this.IsEnabled, value[0], value[1], value[2]);
                if (band != null)
                {
                    float savedValue;
                    if (gainValues != null && gainValues.TryGetValue(band.BandCaption, out savedValue))
                    {
                        band.Gain = savedValue;
                    }
                    this.Bands.Add(band);
                }
            }

            system.unlockDSP().ERRCHECK();
            system.update().ERRCHECK();
        }
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:25,代码来源:Equalizer.cs

示例7: ERRCHECK

 static void ERRCHECK(FMOD.RESULT result)
 {
     if (result != FMOD.RESULT.OK)
     {
         Debug.Log("FMOD_Unity: FmodEventImportPostProcessor: " + result + " - " + FMOD.Error.String(result));
      }
 }
开发者ID:Bourinours,项目名称:Projet_Son,代码行数:7,代码来源:FmodEventImportPostProcessor.cs

示例8: FmodMusicParameter

    public FmodMusicParameter(FMOD.MUSIC_ENTITY cue, FmodMusicSystem musicSystem)
    {
        m_id = (int)cue.id;
        m_name = cue.name;

        m_musicSystem = musicSystem;
    }
开发者ID:Bourinours,项目名称:Projet_Son,代码行数:7,代码来源:FmodMusicParameter.cs

示例9: Sound

 internal Sound(FMOD.Sound sound, string file, string name, float volume = 1.0f)
 {
     _sound = sound;
     _file = file;
     _name = name;
     _volume = volume;
 }
开发者ID:Sharparam,项目名称:DiseasedToast,代码行数:7,代码来源:Sound.cs

示例10: CheckResult

 public static void CheckResult(FMOD.RESULT result)
 {
     if (result != FMOD.RESULT.OK)
     {
         UnityEngine.Debug.LogError(string.Format("FMOD Studio: Encounterd Error: {0} {1}", result, FMOD.Error.String(result)));
     }
 }
开发者ID:mutatis,项目名称:WereWolfTheApocalipse,代码行数:7,代码来源:EditorUtils.cs

示例11: FMOD_EVENT_CALLBACK

        private static FMOD.RESULT FMOD_EVENT_CALLBACK(IntPtr eventraw, FMOD.EVENT_CALLBACKTYPE type, IntPtr param1, IntPtr param2, IntPtr userdata)
        {
            unsafe
            {
                switch (type)
                {
                    case FMOD.EVENT_CALLBACKTYPE.SOUNDDEF_CREATE :
                    {
                        int entryindex   = *(int*)param2.ToPointer() ;     // [in]  (int) index of sound definition entry
                        uint *realpointer = (uint *)param2.ToPointer();    // [out] (FMOD::Sound *) a valid lower level API FMOD Sound handle

                        FMOD.Sound s = null;
                        fsb.getSubSound(entryindex, ref s);

                        *realpointer = (uint)s.getRaw().ToPointer();

                        break;
                    }

                    case FMOD.EVENT_CALLBACKTYPE.SOUNDDEF_RELEASE :
                    {
                        break;
                    }
                }

            }
            return FMOD.RESULT.OK;
        }
开发者ID:sanyaade,项目名称:vsxu-dirty,代码行数:28,代码来源:programmer_sound.cs

示例12: ERRMSG

 internal static String ERRMSG(FMOD.RESULT result)
 {
     if (result != FMOD.RESULT.OK)
     {
         return FMOD.Error.String(result);
     }
     return "";
 }
开发者ID:IndiegameGarden,项目名称:TTMusicEngine,代码行数:8,代码来源:Util.cs

示例13: onBeat

	public FMOD.RESULT onBeat(FMOD.Studio.EVENT_CALLBACK_TYPE type, IntPtr eventInstance, IntPtr parameters) {
		foreach (FMODCallback function in callbacks) {
			function.Invoke(type, eventInstance, parameters);
		}

	    queue.RemoveAll(callback => callback.Invoke(type, eventInstance, parameters));
		return FMOD.RESULT.OK;
	}
开发者ID:frugs,项目名称:RitualRhythm,代码行数:8,代码来源:BeatExecutor.cs

示例14: GetFmodPath

 public string GetFmodPath(FMOD.Studio.EventInstance fmodEvent)
 {
     FMOD.Studio.EventDescription ed;
     string path;
     fmodEvent.getDescription(out ed);
     ed.getPath(out path);
     return path;
 }
开发者ID:Sgtfishtank,项目名称:Curly-kumquat,代码行数:8,代码来源:AudioManager.cs

示例15: ERRCHECK

    //FMOD error checking codes
    void ERRCHECK(FMOD.RESULT result)
    {
        if (result != FMOD.RESULT.OK)
            {
                Debug.Log("FMOD error! " + result + " - " + FMOD.Error.String(result));

            }
    }
开发者ID:krevat,项目名称:Senior-Design,代码行数:9,代码来源:PlayEx.cs


注:本文中的FMOD类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。