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?
Asked
Active
Viewed 1,080 times
2

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 Answers
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
-
2Why 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