Swift Programming Language Tutorial: AVFoundation : AVAudioPlayer , NSURL, NSBundle and more. This is the first in a series of AV or audio visual videos in Swift. In this video, we will develop a simple App that will play an mp3 file. We will be focusing Swift's AVFoundation framework which allows us to play sound files, record audio and much more.
Script: ======= Hello People and welcome. This is the first in a series of AV or audio visual videos in Swift. We will be focusing Swift's AVFoundation framework which allows us to play sound files, record audio and much more.
In this video, we will develop a simple App that will play an mp3 file. So here's the plan. We will first download a freely available audio file from the web. We will then add this file to our Xcode project. We will also add buttons to play, pause and stop this file. And yeah, we will add a volume controller too. Then we will write some code to bring bring this functionality to life. So lets get going, shall we?
1. An instance of the AVAudioPlayer class, called an audio player, provides playback of audio data from a file or memory. 2. An NSURL object represents a URL that can potentially contain the location of a resource on a remote server, the path of a local file on disk, or even an arbitrary piece of encoded data. 3. An NSBundle object represents a location in the file system that groups code and resources that can be used in a program 4. mainBundle() : The NSBundle object that corresponds to the directory where the application executable is located 4. Some operations are not guaranteed to always complete execution or produce a useful output . As an example, consider the task of reading and processing data from a file on disk. There are a number of ways this task can fail. Distinguishing among these different situations allows a program to resolve some errors and to communicate to the user any errors it cant resolve.
Tools Used: ============ Microphone : Blue Yeti Voice Editor : Audacity Animation : Sparkol Video scribe Illustrations: funza Academy + openclipart.org Video editor + SFX : iMovie + ScreenFlow Computer : MacBook Air Content Creator: Sanjay Noronha