Problem: Trying to create a Mix that is applied to the AVPlayerItem, but it crashes with ECX_BAD_ACCESS the moment it hits setVolumeRampFromStartVolume:
Code:
AVMutableAudioMix *fadeMix = [AVMutableAudioMix au开发者_C百科dioMix]; AVMutableAudioMixInputParameters *params = [AVMutableAudioMixInputParameters alloc]; [params setVolumeRampFromStartVolume:1.0 toEndVolume:0.0 timeRange:CMTimeRangeMake(CMTimeMake(0, 1), CMTimeMake(60, 1))]; [fadeMix setInputParameters:[NSArray arrayWithObject:params]];
I have to assume the problem lies in the CMTimeRangeMake, though most examples I saw (as scarce as they are to find) did things similarly.
Basically I am just trying to create a simple fade out that lasts one minute and progressively goes from 100% to 0%.
I am silly, it was supposed to be
AVMutableAudioMixInputParameters *params = [AVMutableAudioMixInputParameters audioMixInputParameters];
Not
AVMutableAudioMixInputParameters *params = [AVMutableAudioMixInputParameters alloc];
精彩评论