Re: Truncating an audio file
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