简体   繁体   English

音频队列服务-录音

[英]Audio Queue Services - recording

I'm trying to record an audio stream which is streamed using matt gallagher's audio classes. 我正在尝试记录使用matt gallagher的音频类流式传输的音频流。

So far, I've searched the web as I do not really understand the audio queue services. 到目前为止,由于我不太了解音频队列服务,因此我搜索了网络。 I'm quite new to iphone programming, and audio queue services is really a complex part of the iphone programming. 我对iPhone编程非常陌生,并且音频队列服务确实是iPhone编程的一个复杂部分。

I'm stuck on this part of the code : 我停留在代码的这一部分:

if(AudioQueueNewInput(
&dataFormat,
AudioInputCallback,
self,
CFRunLoopGetCurrent(),
kCFRunLoopCommonModes,
0,
&queue) == noErr) { 
} 

Where should I put this please? 我该放在哪里? Because when I add this in the init, it crashes the program. 因为当我在init中添加它时,它使程序崩溃。

 AudioQueueStart(queue, NULL);

After having tried the steps given on this page , I didn't succeed. 在尝试了本页上给出的步骤之后,我没有成功。 It doesn't bug, nor produce any file. 它不会出错,也不会产生任何文件。 I expected it to produce and .aiff file. 我希望它产生和.aiff文件。

Help please... 请帮助...

If you are asking if you need to create an audio queue (and checking to make sure that AudioQueueNewInput worked, eg returned a queue) before starting it, the yes. 如果在启动之前询问是否需要创建音频队列(并检查以确保AudioQueueNewInput工作正常,例如返回了队列),请选择是。

Try looking at Apple's SpeakHere example app (on developer.apple.com) as a template for using audio queues. 尝试将Apple的SpeakHere示例应用程序(在developer.apple.com上)视为使用音频队列的模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM