How to use the AQRecorder from the example

I copied the AQRecorder from the sayHere example along with all the other necessary files. After that, I renamed all the classes in the chain that uses it for .mm due to compilation errors that seem to be resolved now. However, I still cannot figure out how to use the AQRecorder class. In this example, there is another class called SpeakHereController, but that didn't work either. Here is the code for my last attempt:

#import "AQRecorder.h" AQRecorder recorder; [recorder startRecord]; 

error: bad receiver type 'AQRecorder'

I know that this will not work for several reasons, one of which does not call the constructor, and I believe that this should be a pointer. I have many different variations, and, as I said, I also tried using SpeakHereController:

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

However, this gives an error:

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

"AQPlayer :: PauseQueue ()" referenced by: - ​​[SpeakHereController pausePlayQueue] in SpeakHereController.o

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

"AQPlayer :: CreateQueueForFile (__ CFString const *)" referenced: - [SpeakHereController stopRecord] in SpeakHereController.o

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

"AQPlayer :: AQPlayer ()" referenced by: - ​​[SpeakHereController awakeFromNib] in SpeakHereController.o

"AQPlayer :: ~ AQPlayer ()" referenced by: - ​​[SpeakHereController dealloc] in SpeakHereController.o

+2
source share
1 answer

I ended up using

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

However, I only need a recorder, and for this I had to comment on all the AQPlayer links from the file. For some reason, he had a bunch of linker errors with playback methods.

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

+1
source

All Articles