开发者

What Frameworks and imports are necessary to use AVAudioPlayer on iOS?

开发者 https://www.devze.com 2023-03-13 15:33 出处:网络
I\'m trying to play 开发者_StackOverflow社区a sound on iOS using AVAudioPlayer. I added the AVFoundation.framework and MediaPlayer.framework and tried to import AVAudioPlayer.h (this part didn\'t work

I'm trying to play 开发者_StackOverflow社区a sound on iOS using AVAudioPlayer. I added the AVFoundation.framework and MediaPlayer.framework and tried to import AVAudioPlayer.h (this part didn't work), but I still can't instantiate the AVAudioPlayer class.

What am I doing wrong?


#import <AVFoundation/AVAudioPlayer.h> perhaps?


According to the Apple documentation, AVAudioPlayer has been available since iOS 2.2.

Make sure you're using the following import:

#import <AVFoundation/AVAudioPlayer.h>
0

精彩评论

暂无评论...
验证码 换一张
取 消