AVAudioPlayer rate

后端 未结 4 2111
孤独总比滥情好
孤独总比滥情好 2021-01-05 17:41

So I\'m trying to play a sound file at a different rate in iOS 5.1.1, and am having absolutely no luck. So far I have tried setting the rate of the AVAudioPlayer:

         


        
4条回答
  •  自闭症患者
    2021-01-05 18:08

    Modify the code to:

    avPlayer = [[AVPlayer alloc] initWithURL:referenceURL];
    
    [avPlayer play]; //call play first
    
    avPlayer.rate = 0.5; //then set rate
    

提交回复
热议问题