Audio Queue Services Programming Guide

来源:互联网 发布:touch.js swipeleft 编辑:程序博客网 时间:2024/05/29 16:12

介绍Introduction

这个文档描述了怎么使用音频队列服务。(这个服务是一个c的接口编程,位于Core Audio的音频工具箱(Audio Toolbox framework))

       Thisdocument describes how to use Audio Queue Services, a C programming interfacein Core Audio’s Audio Toolbox framework. 

      

音频队列服务What Is Audio Queue Services?

       音频队列服务提供了一个直接的、少管理的方法去纪录和播放在iOS或者Mac OS X的音频。

Audio QueueServices provides a straightforward, low overhead way to record and play audioin iOS and Mac OS X.

这是一个被推荐用于给你的iOS或者Mac OS X应用加上一个基础的录制和回放功能的技术。

It is therecommended technology to use for adding basic recording or playback featuresto your iOS or Mac OS X application.

音频队列服务支持录放下列格式的音频

Audio QueueServices lets you record and play audio in any of the following formats:

线性PCM

Linear PCM.

任何自己设计的压缩格式

Any compressedformat supported natively on the Apple platform you are developing for.

任何用户已经安装解码器的格式

Any other formatfor which a user has an installed codec.

 

音频队列服务是一个高层次的服务,硬件和解码器对其透明。

Audio QueueServices is high level. It lets your application use hardware recording andplayback devices (such as microphones and loudspeakers) without knowledge ofthe hardware interface. It also lets you use sophisticated codecs withoutknowledge of how the codecs work.

同时,支持同时多轨道可控制的播放。

At the sametime, Audio Queue Services supports some advanced features. It providesfine-grained timing control to support scheduled playback and synchronization.You can use it to synchronize playback of multiple audio queues and tosynchronize audio with video.

注意:音频队列服务和MAC OS X中的 SoundManager比较类似。音频队列服务有多轨播放,而Sound Manager已经在Mac OS X v10.5的时候被弃用,而且这家伙不能跑64位机(==#要不要说的这么废)。苹果推荐用音频队列服务取代Sound Manager的位置。

Note: AudioQueue Services provides features similar to those previously provided by theSound Manager in Mac OS X. It adds additional features such as synchronization.The Sound Manager is deprecated in Mac OS X v10.5 and does not work with 64-bitapplications. Apple recommends Audio Queue Services for all new development andas a replacement for the Sound Manager in existing Mac OS X applications.

音频队列服务是个纯c接口,所以可以用在Cocoa应用也可用在Mac OSX的命令行。Demo有时候用c++,或者Core Audio的SDK,不过这没鸟区别,都用的是音频队列服务。

Audio QueueServices is a pure C interface that you can use in Cocoa applications as wellas in Mac OS X command-line tools. To help keep the focus on Audio QueueServices, the code examples in this document are sometimes simplified by usingC++ classes from the Core Audio SDK. However, neither the SDK nor the C++language is necessary to use Audio Queue Services.

谁应该读这个导航?

Who Should ReadThis Guide?

这个导航适用于所有想简单粗暴录放音频的家伙,但是要先会以下这些玩意儿:(-_-#)

Audio QueueServices Programming Guide is useful to all iOS and Mac OS X developers whowant a streamlined, straightforward way to record or play audio. To get themost from this document, you should be familiar with:

C语言

The Cprogramming language

会用xcode

Using Xcode tobuild iOS or Mac OS X applications

 

还要懂Core AudioGlossary文档里面的名词。

The terminologydescribed in Core Audio Glossary

(我不会告诉你这篇文档的链接在这里呢~~~~~~~~~~~~~~)https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CoreAudioGlossary/Glossary/core_audio_glossary.html#//apple_ref/doc/uid/TP40004453-CH210-SW1

 

文档构成

Organization ofThis Document

这篇文档由下列几个章节构成

This guidecontains the following chapters:

 

关于音频队列文档描述了音频队列的容量、结构和内部结构。

“About Audio Queues”describes the capabilities, architecture, and internal workings of audioqueues.

链接

https://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AboutAudioQueues/AboutAudioQueues.html#//apple_ref/doc/uid/TP40005343-CH5-SW1


纪录音频文档描述了怎么纪录音频

“Recording Audio”describes how to record audio.

链接

https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQRecord/RecordingAudio.html#//apple_ref/doc/uid/TP40005343-CH4-SW1

播放音频描述了怎么播放音频

“Playing Audio”describes how to play audio.

链接

https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQPlayback/PlayingAudio.html#//apple_ref/doc/uid/TP40005343-CH3-SW1

 

相关文档

See Also

你可能会发现以下文档比较有用

You may find thefollowing documents helpful:

 

姊妹档Audio QueueServices Reference描述了在音频队列里面的作用功能、回调、常量和数据类型

The companion documentAudio Queue Services Reference provides descriptions of the functions,callbacks, constants, and data types in Audio Queue Services.

https://developer.apple.com/library/ios/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40005343

Core Audio DataTypes Reference说了音频队列里面的基本数据类型

Core Audio DataTypes Reference describes data types essential for using Audio Queue Services.

https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CoreAudioDataTypesRef/Reference/reference.html#//apple_ref/doc/uid/TP40004488

Core AudioOverview提供了Core Audio frameworks的总结,还有一个附录叫Supported Audio File and Data Formats

Core AudioOverview provides a summary of the Core Audio frameworks, and includes anappendix on “Supported Audio File and Data Formats”.

https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/CoreAudioOverview/Introduction/Introduction.html#//apple_ref/doc/uid/TP40003577

https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html#//apple_ref/doc/uid/TP40003577-CH7

Core AudioGlossary定义了用在Core Audio documentation专有名词

Core AudioGlossary defines key terms used in the Core Audio documentation.

https://developer.apple.com/library/ios/documentation/MusicAudio/Reference/CoreAudioGlossary/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004453