根据这些docs,我可以更改AVAudioPlayer的某些设置,包括AVAudioTimePitchAlgorithmVarispeed
设置。我该如何设置此值?我是否需要子类化AVAudioSetting.h?
答案 0 :(得分:4)
如果不需要使用AVAudioPlayer,则可以使用AVPlayer
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];
playerItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithmTimeDomain;
AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
[player play];