コード例 #1
0
        private FMODAudioEngine()
        {
            FMODErr.Check(Factory.System_Create(ref _system));

            uint version = 0;

            FMODErr.Check(_system.getVersion(ref version));
            if (version < VERSION.number)
            {
                throw new ApplicationException(
                          "Error! You are using an old version of FMOD "
                          + version.ToString("X")
                          + ". This program requires "
                          + VERSION.number.ToString("X") + ".");
            }

            FMODErr.Check(_system.init(16, INITFLAG.NORMAL, IntPtr.Zero));
            ChannelGroup channelGroup = null;

            FMODErr.Check(_system.getMasterChannelGroup(ref channelGroup));
            _masterChannelGroup = new FMODGrouping(this, channelGroup);

            _scheduler   = new EventLoopScheduler("AudioEngine");
            _updateTimer = Observable.Interval(TimeSpan.FromMilliseconds(UpdateInterval), _scheduler).Do(_ => Update());
        }
コード例 #2
0
 internal void RemoveGrouping(FMODGrouping channelGroup)
 {
     try
     {
         _channelGroups.Remove(channelGroup);
     }
     catch (Exception e)
     {
         GameLog.Client.Audio.Error(e);
     }
 }
コード例 #3
0
        public IAudioGrouping CreateGrouping(string name)
        {
            FMODGrouping cg = null;

            lock (_updateLock)
            {
                cg        = new FMODGrouping(this, name);
                cg.Parent = Master;
                _channelGroups.Add(cg);
            }
            return(cg);
        }