开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜