Analysis of music apps (for example, QQ music) and appqq

Source: Internet
Author: User

Analysis of music apps (for example, QQ music) and appqq

<1> the core function of QQ music is playing songs.

First, you can use the AVFoundation framework to play audio. However, AVFoundation can only play local music and cannot play it online. Although you can download resources from the network to the local computer before playing the video, you must download all the songs before playing the video.

!

If you want to play the video online, you can select Audio Queue Services in the AudioToolbox framework. The audio queue service can complete audio recording and playback.


An Audio Queue consists of three parts:

Three Buffers: Each buffer is a temporary repository for storing audio data.

Buffer Queue: an ordered Queue containing audio buffers.

One Callback: a custom queue Callback function.


Audio playback process:

Read the audio into the buffer. Once a buffer is filled up, it is placed in the buffer queue and continues to fill in other buffers. When playing the video, then, the system reads the audio from the first buffer and plays the video. Once the video is played, the callback function is triggered to play the audio from the next buffer and fill it with the first buffer; after filling up, it is placed back to the buffer queue.


Streaming Media

A good player must ensure smooth playback. It must be played while loading. If it is better, it can be played Using Streaming Media.

Details...

<2> obtain a song order and display it in the industry

This part mainly uses AFN to obtain the song information from the network and then display it on the interface. Familiar with the interface display, which is difficult to do. Supplement


<3> download songs to local storage

It is also important to manage offline song downloads. The song name, author, and other related information can be stored in the database, the song source file and the lyrics file, downloaded and saved to the folder specified in the sandbox.


<4> other settings and other functions are similar to those of other software.

You can refer to the QQ player for a detailed explanation of how it is implemented.


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.