views:

13

answers:

0

I have searched all over Apples website and the internet as well as Stackoverflow. Does anyone have any sample code or a tutorial of how I can record audio from the built in mic, and then export that audio via email? Please, I really need it for my app. Could someone email me sample code to henryfbemail(at)gmail.com Thanks a million!

I was also given this code to use with Apples Speakhere example, but I am not sure how to implement it. If someone could help me that would be great!

  • (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self becomeFirstResponder]; [self dismissModalViewControllerAnimated:YES]; }

  • (void)mailAttachedWavFile { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"My Wav File"]; // optional NSString *fileName = @"recordedFile.wav"; // whatever NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:fileName]; NSData *data = [NSData dataWithContentsOfFile:path]; [picker addAttachmentData:data mimeType:@"audio/x-wav" fileName:fileName]; NSString *emailBody = @"Wav format sound file attached."; // optional [picker setMessageBody:emailBody isHTML:YES]; [self presentModalViewController:picker animated:YES]; [picker release]; }