2013-08-01 75 views

回答

2

由於安德烈亞斯左納州在his answer

您可以在MTAudioProcessingTap輕鬆地添加到您現有的AVPlayer 項目,你的進程回調函數中複製所選通道的樣本給另一個信道 。這裏是一個偉大的教程 解釋基礎:

http://chritto.wordpress.com/2013/01/07/processing-avplayers-audio-with-mtaudioprocessingtap/

的代碼:

NSURL *assetURL = [[NSBundle mainBundle] URLForResource:@"skyfall" withExtension:@"m4a"]; 
assert(assetURL); 

// Create the AVAsset 
AVAsset *asset = [AVAsset assetWithURL:assetURL]; 
assert(asset); 

// Create the AVPlayerItem 
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset]; 
assert(playerItem); 

斷言([資產磁道]); assert([[asset tracks] count]);

self.player = [AVPlayer playerWithPlayerItem:playerItem]; assert(self.player);

[self.player play];

+0

謝謝,我看了一下博客(這似乎是Taps文檔的唯一形式),它看起來像一條可能的路線,但該功能是在iOS6中添加的,我的應用需要定位到iOS5,所以這就是有點問題。 – loadedion

相關問題