function to build srt file, tested and working