/*
File: AQRecorder.h
Abstract: Helper class for recording audio files via the AudioQueue
Version: 2.4
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2009 Apple Inc. All Rights Reserved.
*/
#include <AudioToolbox/AudioToolbox.h>
#include <Foundation/Foundation.h>
#include <libkern/OSAtomic.h>
#include "CAStreamBasicDescription.h"
#include "CAXException.h"
#define kNumberRecordBuffers 3
#define kBufferDurationSeconds 0.5
class AQRecorder
{
public:
AQRecorder();
~AQRecorder();
UInt32 GetNumberChannels() const { return mRecordFormat.NumberChannels(); }
CFStringRef GetFileName() const { return mFileName; }
AudioQueueRef Queue() const { return mQueue; }
CAStreamBasicDescription DataFormat() const { return mRecordFormat; }
void StartRecord(CFStringRef inRecordFile);
void StopRecord();
Boolean IsRunning() const { return mIsRunning; }
UInt64 startTime;
private:
CFStringRef mFileName;
AudioQueueRef mQueue;
AudioQueueBufferRef mBuffers[kNumberRecordBuffers];
AudioFileID mRecordFile;
SInt64 mRecordPacket; // current packet number in record file
CAStreamBasicDescription mRecordFormat;
Boolean mIsRunning;
void CopyEncoderCookieToFile();
void SetupAudioFormat(UInt32 inFormatID);
int ComputeRecordBufferSize(const AudioStreamBasicDescription *format, float seconds);
static void MyInputBufferHandler( void * inUserData,
AudioQueueRef inAQ,
AudioQueueBufferRef inBuffer,
const AudioTimeStamp * inStartTime,
UInt32 inNumPackets,
const AudioStreamPacketDescription* inPacketDesc);
};
分享到:
相关推荐
有时候会碰到cuda报错,OSError: libcudart.so.10.0: cannot open shared object file: No such file 原因是cuda动态链接库没有链接上。 解决方法如下: cuda10.0: sudo ldconfig /usr/local/cuda-10.0/lib64 cuda...
fatal error: pcre2.h: No such file or directory 27 | #include "pcre2.h" 安装swoole遇到错误,把pcre2.h 放到、usr/include下
在windows环境下的jni.h jni_md.h文件。 实际上是从jdk1.8安装完毕后,从文件夹下取得的。 jni.h在【jdk1.8.0_144\include】路径下。 jni_md.h在【jdk1.8.0_144\include\win32】路径下(linux版把win32换成linux...
OSError: libcusparse.so.11: cannot open shared object file: No such file or directory 搜索全网,也没找到解决方案。最快解决方案如下: 1、在 /home/user/anaconda3/lib/ 中放入缺少的 libcusparse.so.11 文件...
VS2010没有inttypes.h文件,程序运行时无法打开包括文件:“inttypes.h”: No such file or directory,解决方案。
网友分享的能够解决fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory问题的程序。MySQL-python-1.2.3.win32-py2.7.exe-32位MySQL-python-1.2.3.win-amd64-py...
error C1083: 无法打开包括文件:“pthread.h”: No such file or directory cocos2d-x-2.1.5\extensions\AssetsManager\AssetsManager.h 30 1 AssetsManagerTest
解决方案】 ...2. 解压后把inttypes.h和stdint.h放到vc的include目录就可以了。我安装的是VS2008,安装到的默认位置,因此include的路径就是:C:\Program Files\Microsoft Visual Studio 9.0\VC\include
fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory. stdint.h是c99标准的头文件,vc不支持,所以肯定会提示“No such file or directory”的。使用方法:下载压缩包,解压得到两个.h...
fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory 【错误】fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory 【原因】stdint.h是c99标准的头文件,vc不...
fatal error: zmq.hpp: No such file or directory compilation terminated. 找不到zmq.hpp的原因是, zmq.hpp只存在master中。 如果你使用release版本,那么是没有zmq.hpp这个文件的。去master中找到zmq.hpp。 将...
下载该文件后,分别将glaux.h、glaux.dll、glaux.lib拷贝到VS2013的安装目录即:VS2013/VC/lib ; VS2013/VC/bin ; VS2013/VC/include/GL中,重新编译即可。
### 解决方案:“fatal error C1083: 无法打开包括文件:“afxcontrolbars.h”” 在使用Visual Studio 2008 (VS2008) 进行开发时,可能会遇到一个常见的错误:“fatal error C1083: 无法打开包括文件:...
在Linux系统中,当您尝试编译某个项目或软件,特别是涉及到网络安全和加密的库时,可能会遇到“fatal error: openssl/sha.h: No such file or directory”这样的错误。这个错误意味着您的系统缺少OpenSSL库的头文件...
- 选择`File -> Properties`,在弹出的对话框中选择`Paths and Symbols`选项卡。 - 在`Include Paths`区域点击`Add`按钮,添加包含`xgpio.h`头文件的路径。 - 通常情况下,该路径为`C:\Xilinx\14.4\ISE_DS\EDK\sw...
在编程过程中,我们可能会遇到各种错误,其中"fatal error C1083: Cannot open include file: 'io.h': No such file or directory"是C++编译器在Windows环境中经常碰到的一个典型问题。这个错误表明在尝试编译代码时...
error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory 缺少的文件libfreetype.so.6
my_config.h: No such file or directory. 解决办法:1)mysql版本太高,可降低版本 --此路一般不会考虑 2)注意下载的mysql-python的版本是否符和当前版本兼容 2)下载附件中的文件,放至/usr/include目录下,重新...
fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory stdint.h是c99标准的头文件,vc不支持,所以肯定会提示“No such file or directory”的。 解决办法:下载文件之后将文件移动到...