public PdProvider(Player player)
 {
     _buffer = new float[player.BufferSize];
     _player = player;
     _player.BufferReady += PdBufferReady;
     _circularBuffer =  new CircularBuffer(_player.SampleRate * 5); // 5 seconds should be enough for anybody
     _minBuffer =  _player.SampleRate / 2; // 0.5 second
     RefillBuffer();
 }
        Controller(string assetsFolder, bool useJack)
        {
            _player = new Player(assetsFolder);
            _player.TeamStarting += ((sender, args) =>
            {
                if (TeamStarting != null)
                {
                    TeamStarting(this, args);
                }

            });
            _player.TeamPlayed += ((sender, args) =>
            {
                if (TeamPlayed != null)
                {
                    TeamPlayed(this, args);
                }
            });
            _player.TableDone += ((sender, args) =>
            {
                if (TableDone != null)
                {
                    TableDone(this, args);
                }
            });
            if (useJack)
            {
                _naudio = new NAudioJack(new PdProvider(_player));
            }
            else
            {
                _naudio = new NAudioWasapi(new PdProvider(_player));

            }

        }