Random sea waves are often modeled as stationary processes for short or moderately long periods of time and therefore the problem of detecting changes in the sea state is very important. We look at this problem from the spectral point of view, proposing a method based on the total variation distance. The method considers processes normalized to have unit variance and looks at changes in the energy distribution through the energy spectra, by looking at their total variation distance. This distance measures the difference between two probability densities by determining how much they have in common, or equivalently, how much one of them has to be modified to coincide with the other, and the spectrum of a normalized process can be seen as the probability density of the energy distribution. The problem of detecting changes in the spectral distribution of energy for processes which are piecewise stationary has been considered in several areas, but the focus has been mainly on instantaneous or nearly instantaneous changes, and the methods developed usually give unreliable results when changes occur slowly, over a period of time. Our method takes into account this phenomenon, by considering the total variation distance not only for contiguous intervals but also for intervals separated by a time interval and using a global optimization method. We present examples of segmentation of wave records and compare our results with alternative methods for detecting spectral changes.