Playing an Audio from a Local File in iPhone Application

I am going to demonstrate “How to play an audio file which is locally placed in your iPhone application project?”.

1) Add Framework to your project as follows.

AVFoundation Framework

2) Select and add following framework

AVFoundation Framework

3) Open your class where you want to use this framework and place following code.

AudioPlayer

 

 

4)  Now place following code in your implementation file which will play audio.

Please keep in mind that, Following code is just for playing audio locally & not from any URL.


5) To stop audio place following code.

Leave a Reply

Your email address will not be published. Required fields are marked *



*