Dear All,
I created file using code:
XThrowIfError(AudioFileCreateWithURL(url, kAudioFileWAVEType, &mRecordFormat, kAudioFileFlags_EraseFile,&mRecordFile), "AudioFileCreateWithURL failed");
CFRelease(url);
mRecordFormat.mChannelsPerFrame=1;
mRecordFormat.mSampleRate=8000;
mRecordFormat.mFormatID = inFormatID;
if (inFormatID == kAudioFormatLinearPCM)
{
// if we want pcm, default to signed 16-bit little-endian
mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger| kLinearPCMFormatFlagIsPacked;
//mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
//mRecordFormat.mFormatFlags|=~ kLinearPCMFormatFlagIsSignedInteger;
mRecordFormat.mBitsPerChannel =8;
mRecordFormat.mBytesPerPacket = mRecordFormat.mBytesPerFrame = (mRecordFormat.mBitsPerChannel / 8) * mRecordFormat.mChannelsPerFrame;
mRecordFormat.mFramesPerPacket = 1;
}
It was recording and showing size of the file,and not playing in iphone or other players also.
Is there any another seetings required in Recording format for this.
Please help,
Regards,
Medwrite
I created file using code:
XThrowIfError(AudioFileCreateWithURL(url, kAudioFileWAVEType, &mRecordFormat, kAudioFileFlags_EraseFile,&mRecordFile), "AudioFileCreateWithURL failed");
CFRelease(url);
mRecordFormat.mChannelsPerFrame=1;
mRecordFormat.mSampleRate=8000;
mRecordFormat.mFormatID = inFormatID;
if (inFormatID == kAudioFormatLinearPCM)
{
// if we want pcm, default to signed 16-bit little-endian
mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger| kLinearPCMFormatFlagIsPacked;
//mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
//mRecordFormat.mFormatFlags|=~ kLinearPCMFormatFlagIsSignedInteger;
mRecordFormat.mBitsPerChannel =8;
mRecordFormat.mBytesPerPacket = mRecordFormat.mBytesPerFrame = (mRecordFormat.mBitsPerChannel / 8) * mRecordFormat.mChannelsPerFrame;
mRecordFormat.mFramesPerPacket = 1;
}
It was recording and showing size of the file,and not playing in iphone or other players also.
Is there any another seetings required in Recording format for this.
Please help,
Regards,
Medwrite