Fixed the recorded class so that the wave file stops playing at the right time and doesn't crash the program.