Example #1
0
        public void Play()
        {
            try
            {
                lock (_updateLock)
                {
                    Stop();
                    _isPlaying = true;

                    if (_musicEntry.Value != null)
                    {
                        _audioTrack = _engine.CreateTrack(
                            ResourceManager.GetResourcePath(_musicEntry.Value.FileName));

                        GameLog.Client.Audio.DebugFormat("called! _musicEntry.Value.FileName: {0}", _musicEntry.Value.FileName);

                        if (_audioTrack != null)
                        {
                            _audioTrack.Group = _channelGroup;
                            _audioTrack.Play(OnTrackEnd);

                            if (_updateTimerSubscription == null)
                            {
                                _updateTimerSubscription = _updateTimer.Subscribe();
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                GameLog.Client.Audio.Error(e);
            }
        }