• 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: Truncating an audio file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Truncating an audio file


  • Subject: Re: Truncating an audio file
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 31 Jul 2013 22:06:58 -0700


On Jul 31, 2013, at 12:34 PM, patrick machielse <email@hidden> wrote:

In an application, I'm recording audio to file using the ExtAudioFile API. After recording is finished, there may be the need to chop off up to 60 seconds of audio from the end of the file (which will be silence).

ExtAudioFile doesn't seem to have functions that would support this type of operation.

It’s been a long time since I looked at the API; if it has a way to get the byte offset corresponding to a particular timestamp, you can then just pass that offset to the truncate() system call.

Whether this will actually work correctly depends on the file format, though. It should work with MPEG-type formats like MP3 and AAC because the decoder just looks for frames in the file and doesn’t expect anything else around them. It might not work for AIFF though. Experiment :)

—Jens
 _______________________________________________
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

  • Follow-Ups:
    • Re: Truncating an audio file
      • From: Kevin Dixon <email@hidden>
References: 
 >Truncating an audio file (From: patrick machielse <email@hidden>)

  • Prev by Date: Truncating an audio file
  • Next by Date: Re: Truncating an audio file
  • Previous by thread: Truncating an audio file
  • Next by thread: Re: Truncating an audio file
  • Index(es):
    • Date
    • Thread