0

iPhone を iOS 7 にアップデートした後、TPAACAudioConverter を使用すると問題が発生します。

「セットアップ セッション カテゴリの結果 560557673 21696E69 ini!」というエラーが表示される 「オーディオ セッションの初期化結果 1768843636 696E6974 ティニ」というエラーが表示される</p>

どうすれば修正できますか?そして時々それはうまくいきます。

-(void)convertToLowBWM4A
{
    [self.statusLine setText:@"Converting to 8Khz Audio..."];
    if ( ![TPAACAudioConverter AACConverterAvailable] ) {
        [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Converting audio", @"")
                                     message:NSLocalizedString(@"Couldn't convert audio: Not supported on this device", @"")
                                    delegate:nil
                           cancelButtonTitle:nil
                           otherButtonTitles:NSLocalizedString(@"OK", @""), nil] show];
        return;
    }

//    // Initialise audio session, and register an interruption listener, important for AAC conversion
//    if ( !checkResult(AudioSessionInitialize(NULL, NULL, interruptionListener, (__bridge void *)(self)), "initialise audio session"))
//        {
//        [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Converting audio", @"")
//                                     message:NSLocalizedString(@"Couldn't initialise audio session!", @"")
//                                    delegate:nil
//                           cancelButtonTitle:nil
//                           otherButtonTitles:NSLocalizedString(@"OK", @""), nil] show];
//        return;
//    }


    // Set up an audio session compatible with AAC conversion.  Note that AAC conversion is incompatible with any session that provides mixing with other device audio.
    UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;
    if ( !checkResult(AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory), "setup session category") ) {
        [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Converting audio", @"")
                                     message:NSLocalizedString(@"Couldn't setup audio category!", @"")
                                    delegate:nil
                           cancelButtonTitle:nil
                           otherButtonTitles:NSLocalizedString(@"OK", @""), nil] show];
        return;
    }

    NSString *filenameStr = [NSString stringWithFormat:@"audio%@.m4a",[self.saveSongID lastObject]];

    NSString *convertedFilenameStr = [NSString stringWithFormat:@"converted%@",filenameStr];
    [self.convertedSongName addObject:convertedFilenameStr];
    NSLog(@"filenameStr %@",filenameStr);
    NSLog(@"convertedFilenameStr %@",convertedFilenameStr);
    audioConverter = [[TPAACAudioConverter alloc] initWithDelegate:self
                                                             source:[[self.docFolders objectAtIndex:0]stringByAppendingPathComponent:filenameStr]
                                                        destination:[[self.docFolders objectAtIndex:0] stringByAppendingPathComponent:convertedFilenameStr]];
   [audioConverter start];
}

乾杯

4

1 に答える 1

0

私は最終的に AVAssetWriter と AVAssetReader を使用して仕事をしました

于 2013-09-20T06:45:06.663 に答える