-1

I have been pondering this for a few days now, but i cant figure out the best way of doing it. I want to be able to record Audio for 2 min (for example), and once it reaches that length, i want it to start deleteing the beginning of the recording so as to keep the audio file at the same length as it continues recording.

I was thinking maybe doing it so once it reaches a specific length, it starts deleting 1 second segments of the audio or something. but i am really not sure what to do.

Does anyone have any idea of the best way of accomplishing the above, so that it keeps recording, but keeps the audio file at a specific length?.

Thanks in advance

Cheers Corey

Fishingfon
  • 1,014
  • 2
  • 14
  • 32
  • 1
    This doesn't sound like a Java or Android question. Can you narrow down what you're wanting? – chrylis -cautiouslyoptimistic- Aug 10 '13 at 12:58
  • Hi, i am creating a android app (hence the android and java tags). I want to be able to continuously record audio with the app, but only save the last x minutes, so it goes around in a loop, but it always keeps the x amount of the recording saved (so it doesnt just record 10 mins, then restart from 0, and record 10 min again). i hope i am making my self clear. Thanks Corey – Fishingfon Aug 10 '13 at 15:24

1 Answers1

1

How about this: You record into two files, each containing x minutes (x == 2 in your case). You start recording into the first file, switch to the second after x minutes, and then switch back and forth until stop. Then, you concatenate the two files in the correct order and cut out the last x minutes, throw away those two temporary files.

alvi
  • 2,383
  • 1
  • 19
  • 32