• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Record/Playback with AudioQueue on iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Record/Playback with AudioQueue on iPhone


  • Subject: Re: Record/Playback with AudioQueue on iPhone
  • From: William Stewart <email@hidden>
  • Date: Tue, 11 Nov 2008 14:34:31 -0800

I think you are going about this the wrong way. Here's a suggestion for how to do this.

A better way to do this is the following:

It sounds like he wants to do punch-in recording. In the past, I always used multiple files and edit lists to handle this sort of operation. Each recording run would write to a new file. Then the playback engine would be fed an edit list of regions in those files to actually play. Then when you are done and want to finalize the recording into a single file, you just write a new file that contains the contents from the raw files as indicated by the edit list. Then you can toss the raw files.

Note that this will only work with data formats that don't have any inter-packet dependencies which mostly means linear PCM. A-law and Mu-law would also work. For AAC you would have to take care of the priming packets (not hard, just more book-keeping - probably not too easy, but doable)



From: Danny Gonzalez <email@hidden>
Date: November 11, 2008 6:37:01 AM PST
To: email@hidden
Subject: Record/Playback with AudioQueue on iPhone


I am currently using Audio Queues on the iPhone to record and playback audio.


What I would like to be able to do is to record some audio, allow the user to pause the record queue, and to seek back and forward through the audio to select a position from where they can start recording from again.

I have got over the seeking issue by making the playback AudioQueueBuffer sizes small enough so that the play audio queue callback happens at a rate that allows the user to use a slider control to hear the audio as they adjust the slider back and forth.

I think I can achieve the recording at a new position by setting the inStartingPacket parameter of the AudioFileWritePackets function that I call from the Audio Recording Queue callback.

The trouble is this only inserts audio over the previously recorded audio. The file length obviously doesn't change so if the user were to go backwards and record less audio than before, the old audio still remains after the end of the newly recorded audio.

Is there a way I can get the AudioFile to truncate at the point the user starts to insert the new audio, is there some other way I can remove the old audio starting at the insert position or is there a better way about going about this task?




--

Jeff Moore
Core Audio
Apple



_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Record/Playback with AudioQueue on iPhone (From: Danny Gonzalez <email@hidden>)

  • Prev by Date: Re: AudioConverter 8.24 to Float32
  • Next by Date: Re: AudioConverter 8.24 to Float32
  • Previous by thread: Record/Playback with AudioQueue on iPhone
  • Next by thread: AudioConverter 8.24 to Float32
  • Index(es):
    • Date
    • Thread