iOS offers a rich set of tools for working with sound
Here is the link of basic concept of audio
- AVFoundation Framework
- To play and Record audio using a simple interface
- Audio Toolbox
- To Play audio with synchronization capabilities, access packets of incoming audio, parse audio streams, convert audio formats, and record audio with access to individual packets
- OpenAL
- To Provide positional audio playback in games and other applications
Below is table about iOS Audio playback formats and codecs
AudioPlaybackFormats_Codecs
Software codecs support simultaneous playback of multiple sounds, but may entail significant CPU overhead
Hardware codecs support only a single instance of one of the supported formats at a time
- CoreAudio & AudioToolboxare the low-level C frameworks
- AVFoundation is an Objective-C/Swift framework
- AVAudioEngine is part of AVFoundation
Each sample projects don’t contain test video files due to file's copyright
Proceed as follows steps
-
Add your audio files into each sample projects
-
change some codes for video file name and extension into ViewController.swift
- ex) audioFileURL = Bundle.main.url(forResource: "SimpsonMovie", withExtension: "mp4")
-
Run and Play