how to use AQRecorder from speakhere example

安稳与你 提交于 2019-12-11 02:22:16

问题


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];

error: bad receiver type 'AQRecorder'

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];

However this gives error:

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

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

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

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

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

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

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


回答1:


I ended up using this

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

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.

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



来源:https://stackoverflow.com/questions/11318493/how-to-use-aqrecorder-from-speakhere-example

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!