IOS multichannel audio with AVFoundation and Swift

I am currently participating in the research and prototype stages of a project to develop a native iOS application (Swift 3), which includes a multi-channel audio player (several MP3 stereo files). I found very limited information on the Internet, especially written in Swift 3, so I thought I would continue my research. I would pose a question here.

As for the frameworks, I realized how much I have looked so far that AVFoundation will do the job. It is not too low and has a good feature set. It supports playing multiple audio files using AVAudioPlayer . I plan to start prototyping something with this soon.

But I am new to Swift and iOS development with a huge number of libraries, so I wonder if I am missing anything if I am on the right track here. Any answers with general information and thoughts on this matter will be voted. For the accepted answer, indicate an example circuit code using the appropriate structure, AVFoundation, or a valid alternative.

If there is no response, I will send my own code when I get there.

In particular, I need from two to ten input channels, from MP3 files in the project resources, each with its own gain, which can be set individually, and then all these mixed, supporting their stereo channels, to one output (device) with the main gain . Some tracks need to go in cycles, while others do not. Tracks must be precisely synchronized. This is just for information, and the circuit code will perfectly cover important points.

Research Notes and Resources

Apple: AVFoundation

Collection of resources related to AVFoundation.

Apple: AVFoundation Programming Guide

This document seems encouraging, but in fact it concerns only the video. It says:

API- AVFoundation - API, API, . , , . , .

" ", Apple , , Google , Apple. , .

Rudi Strahl: AVFoundation

AVComposition AVPlayer s. Objective-C. , AVPlayers . , AVAudioMix. . , .

AVAudioSession, :

AVAudioSession . :

  • .
  • , .
  • , .

Techotopia: iOS 10 AVAudioPlayer

AVAudioPlayer.

: AVAudioPlayer

Swift . .

Swift: AVAudioPlayer

, .

Sweet Tutos: - AVAudioPlayer Tutorial

Swift 3. .

Xamarin: AVAudioPlayer

Swift 2, .

Apple Video: WWDC 2013 AV Kit AV Foundation

, 30 , AV Kit AV Foundation OS X 10, .

+4

Source: https://habr.com/ru/post/1662340/


All Articles