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()); }
internal void RemoveGrouping(FMODGrouping channelGroup) { try { _channelGroups.Remove(channelGroup); } catch (Exception e) { GameLog.Client.Audio.Error(e); } }
public IAudioGrouping CreateGrouping(string name) { FMODGrouping cg = null; lock (_updateLock) { cg = new FMODGrouping(this, name); cg.Parent = Master; _channelGroups.Add(cg); } return(cg); }