Settings AVAudioTimePitchAlgorithmVarispeed for AVFoundationAudioSettings

后端 未结 1 548
忘掉有多难
忘掉有多难 2021-01-22 21:31

According to these docs, I can change certain settings for AVAudioPlayer, including AVAudioTimePitchAlgorithmVarispeed setting. How would I set this value? Do I nee

1条回答
  •  甜味超标
    2021-01-22 21:54

    If no required use of AVAudioPlayer, you can use AVPlayer

    AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];
    playerItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithmTimeDomain;
    AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
    [player play];
    

    0 讨论(0)
提交回复
热议问题