如何从这里的示例使用AQRecorder [英] how to use AQRecorder from speakhere example

查看:103
本文介绍了如何从这里的示例使用AQRecorder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从speakHere示例以及所有其他需要的文件中复制了AQRecorder.这样做之后,由于编译错误,我现在将链中使用它的所有类重命名为.mm,现在似乎已经解决了. 但是我仍然不知道如何使用AQRecorder类.在该示例中还有另一个名为SpeakHereController的类,但该类也不起作用. 这是我最近尝试的代码:

I have coppied over AQRecorder from the speakHere example along with all the other needed files. After doing so I renamed any classes in the chain that uses it to .mm due to compilation errors, which seem to be resolved now. However I still cannot figure out how to use the AQRecorder class. There is another class in that example called SpeakHereController but that didnt work either. Here is the code for my latest attempt:

#import "AQRecorder.h"

    AQRecorder recorder;
    [recorder startRecord];

错误:接收器类型为"AQRecorder"错误

error: bad receiver type 'AQRecorder'

我知道这不会工作有几个原因,一个原因是它没有调用构造函数,我也相信这应该是一个指针. 我有许多不同的变化,就像我说过的,我也尝试过使用SpeakHereController:

I know this wont work for a few reason, one its not calling the constructor, also I believe this should be a pointer. I have many different variations and like I said I also tried using SpeakHereController:

 SpeakHereController * recorder;
    recorder = [[SpeakHereController alloc]init];
        [recorder startRecord];

但是这会导致错误:

体系结构i386的未定义符号:"AQPlayer :: StopQueue()", 引用自: -SpeakHereController.o中的[SpeakHereController stopPlayQueue]

Undefined symbols for architecture i386: "AQPlayer::StopQueue()", referenced from: -[SpeakHereController stopPlayQueue] in SpeakHereController.o

"AQPlayer :: PauseQueue()",引用自: -SpeakHereController.o中的[SpeakHereController pausePlayQueue]

"AQPlayer::PauseQueue()", referenced from: -[SpeakHereController pausePlayQueue] in SpeakHereController.o

"AQPlayer :: DisposeQueue(unsigned char)",引用自: -SpeakHereController.o中的[SpeakHereController stopRecord]

"AQPlayer::DisposeQueue(unsigned char)", referenced from: -[SpeakHereController stopRecord] in SpeakHereController.o

"AQPlayer :: CreateQueueForFile(__ CFString const *)",引用自: -SpeakHereController.o中的[SpeakHereController stopRecord]

"AQPlayer::CreateQueueForFile(__CFString const*)", referenced from: -[SpeakHereController stopRecord] in SpeakHereController.o

"AQPlayer :: StartQueue(signed char)",引用自: -[SpeakHereController播放:]在SpeakHereController.o中 SpeakHereController.o

"AQPlayer::StartQueue(signed char)", referenced from: -[SpeakHereController play:] in SpeakHereController.o interruptionListener(void*, unsigned long) in SpeakHereController.o

"AQPlayer :: AQPlayer()",引用自: -[SpeakHereController awakeFromNib] in SpeakHereController.o

"AQPlayer::AQPlayer()", referenced from: -[SpeakHereController awakeFromNib] in SpeakHereController.o

"AQPlayer ::〜AQPlayer()",引用自: -SpeakHereController.o中的[SpeakHereController dealloc]

"AQPlayer::~AQPlayer()", referenced from: -[SpeakHereController dealloc] in SpeakHereController.o

推荐答案

我最终使用了此

   SpeakHereController * recorder;
    recorder = [[SpeakHereController alloc]init];
    [recorder awakeFromNib];

但是,我只需要记录器,为了使其正常工作,我必须从文件中注释掉所有AQPlayer引用.无论出于何种原因,它的play方法都有很多链接器错误.

However I only needed the recorder and for this to work I had to comment out all AQPlayer references from the file. For whatever reason it had a bunch of linker errors with the play methods.

调用awakeFromNib的原因是该方法与init很像,它初始化了AQRecorder/AudioQueue的所有设置

the reason for calling awakeFromNib is that the method is alot like init, initializing all the settings for AQRecorder/AudioQueue

这篇关于如何从这里的示例使用AQRecorder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆