Re: MTCoreAudio, CAAudioFileWriter and conversion
Re: MTCoreAudio, CAAudioFileWriter and conversion
- Subject: Re: MTCoreAudio, CAAudioFileWriter and conversion
- From: Jens Alfke <email@hidden>
- Date: Mon, 10 Oct 2005 20:09:29 -1000
On 10 Oct '05, at 5:45 PM, Olivier Destrebecq wrote: My code run, the file gets created, but then when i try to open it with Quicktime, it tells me it cannot open it. Also if i add code to try to convert to AAC before writing to disk i get an error. I include the code in this email for your review.
The code you showed us doesn't ever close the output file. Are you just killing the process after recording enough audio? As far as I can tell, an AIFF file has to be explicitly closed after writing the data, so that the writer can either add a necessary trailer or update the header. Otherwise the file isn't openable.
My question would be: in minimal lines of code, how would one save a sampled sound buffer (which MTCoreAudio provides) into an AIFF file.
It's really easy using CAAudioFile. You call CreateNew() on the file object, repeatedly call its Write() method passing in a buffer list, then call Close().
--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