【发布时间】:2015-09-21 14:44:39
【问题描述】:
我有一个应用程序,它通过 AVMutableComposition 将本地文件加载到 avPlayer 中,它可能有多达 6 个音频和视频轨道作为合成的一部分。
我有一个 UISlider,用于调整播放器中每个音轨的音量。
以下是用于更新音量的代码。
- (void)updateVolumeForTake:(Take *)take
{
NSInteger trackID = // method that gets trackID
AVMutableAudioMix *audioMix = self.player.currentItem.audioMix.mutableCopy;
NSMutableArray *inputParameters = audioMix.inputParameters.mutableCopy;
AVMutableAudioMixInputParameters *audioInputParams = [inputParameters filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:kTrackIdPredicate, trackID]].firstObject;
[audioInputParams setVolume:myNewVolumeFloat atTime:myDesiredTime];
audioMix.inputParameters = inputParameters;
AVPlayerItem *playerItem = self.player.currentItem;
playerItem.audioMix = audioMix;
}
这目前在 appStore 中,自 iOS6 以来一直存在,并且一直没有问题。 在运行 iOS9 的设备上,上述内容根本不起作用。我查看了发行说明,虽然其中提到了 AVFoundation,但我没有看到任何关于 AVAudioMix 的信息。我在 Google 上四处搜索,没有发现其他人遇到此问题。
我还尝试使用 AVPlayer 和 UISlider 创建一个新项目,但我看到了相同的行为。
我的问题如下,有没有其他人遇到过这个问题? 有人知道与此相关的已知错误吗?
【问题讨论】: