Reputation: 7860
I want the user to be able to record audio in an app, and then to be able to select part of the file and rerecord it. For example, perhaps they initially record "How now, brown cow," then select the end of that and rerecord "frown sow." This would be merged into the initial file, which would then be "How now, frown sow."
This seems to be far more difficult than I expected. Can I do this with 3GP format files? If not, how can I convert them to the format I need?
I want to be able to say "take this just-recorded audio file. It will fill from the 5-second to the 10-second section of this other media file, now save the new, edited file." I gather converting between milliseconds, frames, samples and bytes could make this even more complicated.
I'm examining the Ringdroid app (I'm SO thankful it's open source!) which at least does something similar, but is very complicated with little in the way of comments... hopefully it's much more complicated than I need.
I did see this other thread, but even if it was what I needed, I don't believe those classes are a part of Android: Saving part of an audio file (Java)
Upvotes: 2
Views: 2976
Reputation: 7860
I was finally able to edit parts of a 3GP file.
I used the CheapAMR (which also manages 3GP) and CheapSoundFile classes from RingDroid, as well as a new "AudioFileHandler" class.
I learned some important lessons along the way:
Upvotes: 5