Lifetime-based optical sensing of pH using resonance energy transfer in sol—gel films