1

Novocaine のサンプル プロジェクトから m4a ファイルを出力します。しかし、iTunes でファイルを開くことができません。ファイルが壊れている可能性があります。

NSArray *pathComponents = [NSArray arrayWithObjects:
                               [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], 
                               @"My Recording.m4a", 
                               nil];
NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents];
NSLog(@"URL: %@", outputFileURL);

self.fileWriter = [[AudioFileWriter alloc]
                   initWithAudioFileURL:outputFileURL 
                   samplingRate:self.audioManager.samplingRate
                   numChannels:self.audioManager.numInputChannels];


__block int counter = 0;
self.audioManager.inputBlock = ^(float *data, UInt32 numFrames, UInt32 numChannels) {
    [wself.fileWriter writeNewAudio:data numFrames:numFrames numChannels:numChannels];
    counter += 1;
    if (counter > 800) { // roughly 5 seconds of audio
        wself.audioManager.inputBlock = nil;
    }
};

コードは変更せず、コメントアウトを削除しただけです。

考えられる解決策や提案をご存知でしたら、私を共有していただけないでしょうか。

ノボカインhttps://github.com/alexbw/novocaine

4

1 に答える 1