Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to play 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?

like image 626
cfischer Avatar asked Jun 17 '11 21:06

cfischer


People also ask

What is AVFoundation framework?

AVFoundation is the full featured framework for working with time-based audiovisual media on iOS, macOS, watchOS and tvOS. Using AVFoundation, you can easily play, create, and edit QuickTime movies and MPEG-4 files, play HLS streams, and build powerful media functionality into your apps.

What is Avaudioplayer?

An object that plays audio data from a file or buffer.


1 Answers

#import <AVFoundation/AVAudioPlayer.h> perhaps?

like image 159
Alex Kremer Avatar answered Sep 20 '22 16:09

Alex Kremer