On Oct 11, 2005, at 4:00 PM, Olivier Destrebecq wrote:
MTCoreAudioStreamDescription *audioStreamDescription = [MTCoreAudioStreamDescription streamDescription];//[[[[[self recordingDevice] streamsForDirection: kMTCoreAudioDeviceRecordDirection] objectAtIndex: 0] streamDescriptionForSide: kMTCoreAudioStreamLogicalSide] copy];
[audioStreamDescription setFormatID: kAudioFormatMPEG4AAC];
[audioStreamDescription setChannelsPerFrame: 2];
If I run "afrecord -f m4af -d 'aac ' /tmp/foo.m4a", then "afinfo /tmp/foo.m4a" shows:
Data format: 2 ch, 44100 Hz, 'aac ' (0x00000002) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
How does this compare with the AudioStreamBasicDescription you are setting on the file? The (2) is mFormatFlags but I don't believe you need to be setting that.
Doug