Extract iPod Library raw PCM samples and play with sound effects

后端 未结 4 1965
清歌不尽
清歌不尽 2020-12-04 15:47

I am trying to extract raw PCM samples from an MP3 in the iPod Library so that I can play the song and manipulate the pitch, tempo, and apply sound effects (such as filters)

4条回答
  •  暖寄归人
    2020-12-04 16:50

    I think you want this in there to ensure its PCM...

    NSDictionary* outputSettingsDict = [[NSDictionary alloc] initWithObjectsAndKeys:
    
                            [NSNumber numberWithInt:kAudioFormatLinearPCM],AVFormatIDKey,
                       //     [NSNumber numberWithInt:44100.0],AVSampleRateKey, /*Not Supported*/
                       //     [NSNumber numberWithInt: 2],AVNumberOfChannelsKey,    /*Not Supported*/
    
                            [NSNumber numberWithInt:16],AVLinearPCMBitDepthKey,
                            [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey,
                            [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey,
                            [NSNumber numberWithBool:NO],AVLinearPCMIsNonInterleaved,
    
                            nil];
    
    AVAssetReaderTrackOutput* output = [[AVAssetReaderTrackOutput alloc] initWithTrack:songTrack outputSettings:outputSettingsDict];
    

提交回复
热议问题