ios - kAudioFormat for .aif audio file conversion? -


I would like to convert audio files in AIFF audio formats AIF format / save. Default I'm trying with LineraPCM But saving audio format in AAC format. . I want to save the audio file in my code AIFF format.Here

  NSDictionary * outputSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey, [NSNumber numberWithFloat : 44100.0], [Ansanmber number], [Ansanmber number: 2], Avianmber of pooh Chaanls [Ansdita Detavithbaits and Canlleaut length Saikof (Odiocanel layout)], Avicanl layout that [Ansanmber Snkyaaenaitiaianti: 16], Avieliyrpisimbiteedipthke [ NSNumber No. December Vithbuls: NO], Avieliniyrpisimaiannintrlev [Ansanmber] numberWithBool: NO], AVLinearPCMIsFloatKey, [NSNumber numberWithBool: NO], AVLinearPCMIsBigEndianKey, nil];  

If anyone can help please write to file using AVAssetWriterInput to save consulting AIFF audio format kAudioFormat or audio settings? The

I've worked with so far AVAssetWriter, but I Core Audio basically ASBDs as in the format received details I

AudioBasicStreamDescription an example to define the AIFF see here:

  aiffFormat.mSampleRate = sampleRate; AiffFormat.mFormatID = kAudioFormatLinearPCM; AiffFormat.mBytesPerPacket = 2; AiffFormat.mFramesPerPacket = 1; AiffFormat.mBytesPerFrame = 2; AiffFormat.mChannelsPerFrame = 2; // Stereo Effectate MBitsPrint = 16; Aeffformtkmformtflags = (Clinetrpkmfaormtflagisbijndian | kAudioFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger); AiffFormat.mBitsPerChannel = sizeof (float) * 8; AiffFormat.mBytesPerFrame = aiffFormat.mChannelsPerFrame * sizeof (float32); AiffFormat.mBytesPerPacket = aiffFormat.mFramesPerPacket * aiffFormat.mBytesPerFrame;  

The large funeral should be set to Yes in your above code. To begin, as I have mentioned that I have never worked with AVAssetWriter, so I'm not sure who is to set the parameters of small forward or not, however, walk along the stream details the example above Should not be very difficult.


Comments