  We have measured the temperature dependence of the direct band gap, $E_g$, in
SrTi$^{16}$O$_3$ and BaTiO$_3$ and related materials with quantum-paraelectric
and ferroelectric properties using optical spectroscopy. We show that $E_g$
exhibits an anomalous temperature dependence with pronounced changes in the
vicinity of the ferroelectric transition that can be accounted for in terms of
the Fr\"ohlich electron-phonon interaction with an optical phonon mode, the
so-called soft mode. We demonstrate that these characteristic changes of $E_g$
can be readily detected even in very thin films of SrTi$^{16}$O$_3$ with a
strain-induced ferroelectric order. Optical spectroscopy thus can be used as a
relatively simple but sensitive probe of ferroelectric order in very thin films
of these titanates and probably also in subsequent multilayers and devices.
