iOS Audio 1: Four ways to play audio files (i) Audiotoolbox avfoundation OpenAL Audio QUEUE

Source: Internet
Author: User

this article reprinted to http://blog.csdn.net/u014011807/article/details/40187737

What can you learn in this volume?

Four ways to design audio players for a variety of applications:

Based on the Audiotoolbox.framework framework. Play the system sound file.

Based on the Avfoundation.framework framework. Play a variety of audio format files. Has advanced audio player capabilities. such as real-time display of progress, power, control volume, playback time and so on.

Based on the OpenAL framework. achieve playback on local audio files, play PCM audio files, 3D audio effects.

Based on the Audioqueue audio queue. Enables playback of audio signal streams. You can extract audio stream data in segments.

Using FFmpeg to complete the audio signal codec, such as WAV, MP3 and other audio file types.

Combined with MATLAB simulation software to achieve special sound processing. such as Tom Cat audio.

Use the sound touch Open Source Library for a variety of advanced audio processing. such as male voice change female voice.

iOS Multimedia Layer Structure overview

iOS can generally be divided into four levels, as shown in 1, from an architecture. The Cocoa Touch frame layer (Thecocoa touch layer), the media layer, the core service layer, the core operating system (the kernel OS layer), respectively.

The direct experience that mobile phone brings to the user is no more than audio, image, video. Thus, the multimedia layer plays a very important role in the entire iOS architecture. Using the audio, image, and video framework provided by iOS can help iOS developers quickly complete the advanced audio and video animation experience presented by their customers. These frameworks also provide a convenient way for developers to access the underlying structure. The following respectively on the audio, image, video three aspects of the composition of the multimedia layer.

Audio Technology Layer:

The audio technology layer is designed to include the following frameworks: Avfoundation.framework, Coreaudio.framework, Audiotoolbox.framework, Audiounit.framework, Openal.framework and so on. Each technology layer contains a multitude of framework frameworks, each of which has a variety of methods for OC classes. Here we choose some of the more important classes to introduce you.

Avfoundation.framework:

The avfoundation.framework is a very important layer in the audio technology layer, and it is easy to customize various audio players and achieve some advanced features with the many OC methods it contains. Avfoundation can play sound files and raw audio data from the system. Of course, this framework can also be used to achieve the aliasing effect of sound, while controlling the playback of multiple audio files.

Coreaudio.framework:

Mainly used to customize the data types of various audio.

Audiotoolbox.framework:

You can play or record audio files. You can also manipulate the original audio data file. After a certain setting can also achieve vibration and other effects.

OPEN al.framework:

Open (open audio Library) is a cross-platform audio processing solution. This framework makes it possible to play various audio files conveniently. It also enables playback of PCM audio files. Especially in the 3D sound technology, has a very important role. This technology makes it easy to achieve 3D audio effects in games and special occasions.

The iOS audio technology layer can play audio files in a variety of audio formats, while also playing audio files that have been customized to install the appropriate audio codec. In particular, the following types of audio files are mainly supported:

Wav:wav is an audio format developed by Microsoft, which virtually does not distort the digital audio signals it collects, so it can restore the original information of the sound very well.

MP3: The most popular audio processing algorithm this year, it compresses the size of the data as much as possible without causing too much impact on sound quality.

The full name of the AAC:AAC audio file is Advanced video Coding, which uses a completely different data compression algorithm with MP3, which has a higher price/performance ratio compared to MP3, and better sound quality.

An audio file type that is often stored when recording a Caf:ios device.

......

Image Technology Layer:

Image processing is the basis of video processing, but also is a very important part of the visual experience of people. The image technology layer is designed to include: Core graphics, core Animation, image I/O, OpenGL es, etc. It is precisely because the image technology layer provides these many tools to make it easy for us to process images. Let's take a brief look at the role of each of these technologies.

Core Graphics:

Core Graphics (Coregraphics.framework) mainly uses quartz2d to achieve the processing of two-dimensional images, so it is often referred to as quartz 2D technology.

Core Animation:

In contrast to the two-dimensional image processing, Core animation is mainly used for the production of two-dimensional animation, as well as some advanced advanced visual effects rendering.

Image I/o:

Image I/O (imageio.framework) can be seen as the input and output management of images, which can be used to process the basic pixel information of an image. The use of this framework is based on the Core graphics data types and functions.

OpenGL ES:

OpenGL ES (openglfor Embedded systems) is open GL specifically tailored for embedded operating systems. Provides a complete 2d, 3d image processing API with very powerful features. Is the game image, high-definition image of the first technical solution.

iOS is compatible with a variety of image formats, such as PNG, JPEG, BMP, etc., which are very well supported.

Video Technology layer:

At present, 3G in the domestic already basic popularity, and the resulting high-speed video download, fancy video sharing has become an important feature of the iOS system. To make it easy for developers to customize their own player, iOS offers a wide range of video application frameworks. Media Play.framework

Media play.framework:

Media Play.framework can be seen as a framework for an advanced video player that allows you to quickly design a video player. But the disadvantage is that it is not convenient for users to develop two times.

iOS can play a variety of video type files, such as MP4, M4V, 3GP, MOV and so on.

iOS Audio 1: Four ways to play audio files (i) Audiotoolbox avfoundation OpenAL Audio QUEUE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.