Add functions to calculate maximum time of recording.