Record all sounds created by my application in an audio file (not a microphone)

I have a tool-like screen. There are buttons that play sound files.

I want to record the sounds that are played when the user presses the buttons in one audio file so that I can save this file as mp4 or another audio format.

Could you advise me how to achieve this in a simple way?

I can record using an AVAudioRecorder microphone

I think the recording method uses a microphone as a source, but I would like it to use the equivalent β€œaudio out” of my application to use as a source.

+8
ios xcode audio avaudiorecorder
source share
2 answers

You can try using The Amazing Audio Engine . You can install it through Cocoapods

 pod 'TheAmazingAudioEngine' 

or clone via git

 git clone --depth=1 https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine.git 

Sound can be recorded to a file using this .

So, if you want to record the output of applications, just use the Outputreceiver :

 @property (nonatomic, strong) AEAudioController *audioController; @property (nonatomic, strong) AERecorder *recorder; ... self.audioController = [[AEAudioController alloc] initWithAudioDescription:[AEAudioController nonInterleaved16BitStereoAudioDescription] inputEnabled:YES]; ... //start the recording - (void) beginRecording{ self.recorder = [[AERecorder alloc] initWithAudioController:self.audioController]; NSString *documentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; //the path to record to NSString *filePath = [documentsFolder stringByAppendingPathComponent:@"AppOutput.aiff"]; //start recording NSError *error = NULL; if ( ![_recorder beginRecordingToFileAtPath:filePath fileType:kAudioFileAIFFType error:&error] ) { //an error occured return; } [self.audioController addOutputReceiver:self.recorder]; } ... //end the recording - (void)endRecording { [self.audioController removeOutputReceiver:self.recorder]; [self.recorder finishRecording]; } 
+7
source share

Use Screen Recorder like Camtasia or Fraps . When you want, you can stop recording and extract sound in several formats, and there is no need to use a microphone ... There are also open source ...

-3
source share

All Articles