Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recording #57

Open
acsarraf opened this issue May 30, 2017 · 0 comments
Open

Not recording #57

acsarraf opened this issue May 30, 2017 · 0 comments

Comments

@acsarraf
Copy link

acsarraf commented May 30, 2017

Hi,

I've been trying to set up TAAE1/2 in different apps in an attempt to record the screen output essentially.
In this case, I am using TAAE2 and I have an app where I am loading 2 sounds locally, and I want to be able to start a recording, play and pause the 2 sounds at varying times along with some effects at random times, stop recording and then save the file.

I have linked up Record and PlayRecording buttons to snippets of code similar to what is available in the TAAE2 Sample, but can't seem to get any actual output recorded. When i check through iExplorer, I always have an AppOutput.m4a file on display, but it is always 557 Bytes in size, so i'm guessing it doesn't actually contain any audio.

Before pasting my code in, does recording not work when playing sounds through AVAudioPlayer? I'm not particularly sure about this. Though I did try to start playing the Drums sound that comes with the sample app when i click record and to stop it when i stop recording, but that sound never comes up when i run the app, though my code does enter the if audio.drums.playing section that'll be included below.

Anyway, I will paste snippets of my record and play record functions. Any help would be greatly appreciated.

- (IBAction)recordPressed:(id)sender {
	if (_audioController.recording) {
		if (_audioController.drums.playing) {
			[_audioController.drums stop];
		}
		NSLog(@"stop recording");
		[_audioController stopRecordingAtTime:0 completionBlock:^{
			[self.recordButton setSelected:false];
		}];
	} else {
		@try {
			NSLog(@"Start recording");
			NSError *error;
			[_audioController.drums playAtTime:AETimeStampNone];
			[_audioController beginRecordingAtTime:0 error:&error];
		} @catch (NSException *exception) {
			[_recordButton setEnabled:NO];
		}
	}
}

- (IBAction)playRecorded:(id)sender {
	if (_audioController.playingRecording) {
		NSLog(@"Stop Playing recording");
		[_audioController stopPlayingRecording];
		[_playRecordingButton setSelected:NO];
	} else {
		NSLog(@"Start playing recording");
		[_playRecordingButton setSelected:YES];
		
		[_audioController playRecordingWithCompletionBlock:^{
			[_playRecordingButton setSelected:NO];
		}];
	}
}

Thanks a lot,
Alan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant