AVAudioRecorder を使用してオーディオ WAV (自分の声を録音した) ファイルを作成しました。最終的なファイル形式は WAV ファイルです。ファイルが正常に保存され、自分の声が聞こえます。このファイルをバックエンド サーバー (Web サービス) に送信したいと考えています。しかし、私のサーバーは WAV のデータと FMT 情報のみを受け入れます。FLLR、データ、FMT を含む wav ファイル情報が原因で、wav ファイルを受け付けません。Riffpad ツールで WAV ファイルの情報を確認しました。FLLR、データ、FMTを表示しています。しかし、データと fmt だけが必要です。私のサーバー側はデータと FMT のみを受け入れるためです。プログラムでwavファイルのFLLRを削除する方法を教えてください。
レコードのソース コード:
NSError *error;
// Recording settings
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
[settings setValue: [NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
[settings setValue: [NSNumber numberWithFloat:22050] forKey:AVSampleRateKey];
[settings setValue: [NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey]; // mono
[settings setValue: [NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
[settings setValue: [NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
//[settings setValue: [NSNumber numberWithInt:16] forKey:AudioSampleType];
// File URL
NSURL *url = [NSURL fileURLWithPath:FILEPATH];
//NSLog(@"Url file path ::: %@",url);
// Create recorder
recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error];
if (!recorder)
{
// NSLog(@"Error establishing recorder: %@", error.localizedFailureReason);
return;
}