2

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

Apollo
  • 8,874
  • 32
  • 104
  • 192
  • Different constants apply to different properties in different classes. No one is going to list all of them for you. Which one are you particularly interested in? – matt May 28 '14 at 22:51

1 Answers1

4

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];
Ken Kuan
  • 809
  • 6
  • 8
  • actually a better question is, what happens if the user is iOS 6 and below? – Apollo May 29 '14 at 13:54
  • According to your doc link, this setting only available in iOS 7+. If device is iOS6-, you should disable this function. – Ken Kuan May 29 '14 at 13:56
  • 2
    Why should I add anything? Good answer! However, on the theory that it is better to teach a man to fish to than to give a man a fish, let me tell you (@Apollo) how you would have found this out for yourself: in Xcode, in the documentation window, search on AVAudioTimePitchAlgorithm. – matt May 29 '14 at 14:51