I am currently using audio queues on the iPhone to record and play sound.
What I would like to do is record some sound, allow the user to pause the recording queue and search back and forth through the audio to select the position from which they can start recording again.
I ran into a search problem by making AudioQueueBuffer playback sizes small enough so that the audio playback queue would call back at a speed that allows the user to use the slider control to listen to the sound when they adjust the slider back and forth.
I think that I can achieve recording in a new position by setting the inStartingPacket parameter of the AudioFileWritePackets function, which I call from the callback queue of the audio recording.
The problem is that only audio is inserted on top of previously recorded audio. The file length, obviously, does not change, therefore, if the user had to go back and record less sound than before, the old sound still remains after the end of the recorded sound.
Is there a way in which AudioFile can be truncated at the moment the user starts to insert a new sound, is there another way to delete the old sound starting from the insertion position, or is there a better way about this task?
thank