using optical means for detecting the end of the recording or the desired point thereof