avaudiorecorder

what are the formats supported in AVAudioRecorder for recording sound?

两盒软妹~` 提交于 2019-11-30 12:21:11
问题 I have found a list of the different values (Audio Data Format) at http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CoreAudioDataTypesRef/Reference/reference.html#//apple_ref/doc/uid/TP40004488 Audio Data Format Identifiers Identifiers for audio data formats, used in the AudioStreamBasicDescription structure. kAudioFormatLinearPCM = 'lpcm', kAudioFormatAC3 = 'ac-3', kAudioFormat60958AC3 = 'cac3', kAudioFormatAppleIMA4 = 'ima4', kAudioFormatMPEG4AAC = 'aac ',

AVAudioRecorder record AAC/m4a

吃可爱长大的小学妹 提交于 2019-11-30 12:11:40
问题 I am trying to record audio on the Device using AVAudioRecorder. That file is transmitted to a web server and I want to play that resulting file in a web browser.. I have tried various combinations of settings on the device...nothing seems to encode the file into the correct AAC format. QuickTime says that it doesn't know how to play this file. Sample code private void InitializeRecordingSession() { string fileName = string.Format("{0}.m4a", Guid.NewGuid()); string tmpdir = Environment

Record all sounds generated by my app in a audio file (not from mic)

有些话、适合烂在心里 提交于 2019-11-30 09:13:44
I have a screen that is like an instrument. There are buttons that play sound files. I want to record the sounds played as user presses the buttons in a single audio file so that i can save that file as mp4 or other audio format. Can you please guide me how to achieve this in a simple way? I am able to record using the mic with AVAudioRecorder As I think, the recording method uses the mic as a source, but I would like it to use the "audio out" equivalent of my app to use as a source. You could try using The Amazing Audio Engine . You can install it via Cocoapods pod 'TheAmazingAudioEngine' or

How to increase volume of sound recorded using AVAudioRecorder

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 06:13:10
I am using the link mentioned below to record audio through my iPhone app: How do I record audio on iPhone with AVAudioRecorder? When I try to play my recordings using AVAudioPlayer on my device, I have seen that the sound volume of my recordings is very low even when my device volume is full. Recording is working fine. What can be done to increase the volume? When recording audio, set the audio session to AVAudioSessionCategoryPlayAndRecord or just AVAudioSessionCategoryRecord . When you're done, set it back to just AVAudioSessionCategoryPlayback . Solution for iOS 12 + Swift 5.0 : When

AVAudioRecorder not recording in background after audio session interruption ended

筅森魡賤 提交于 2019-11-30 05:10:58
I am recording audio in my app, both in foreground and in background. I also handle AVAudioSessionInterruptionNotification to stop recording when interruption begins and start again when it ends. Although in foreground it works as expected, when app is recording in background and I receive a call it doesn't start again recording after call ends. My code is the following: - (void)p_handleAudioSessionInterruptionNotification:(NSNotification *)notification { NSUInteger interruptionType = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue]; if

AVAudioRecorder record AAC/m4a

一曲冷凌霜 提交于 2019-11-30 02:09:31
I am trying to record audio on the Device using AVAudioRecorder. That file is transmitted to a web server and I want to play that resulting file in a web browser.. I have tried various combinations of settings on the device...nothing seems to encode the file into the correct AAC format. QuickTime says that it doesn't know how to play this file. Sample code private void InitializeRecordingSession() { string fileName = string.Format("{0}.m4a", Guid.NewGuid()); string tmpdir = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/audio"; if (!Directory.Exists(tmpdir)) Directory

AVAudioRecorder Won't Record On Device

此生再无相见时 提交于 2019-11-29 20:40:28
问题 This is my method: -(void) playOrRecord:(UIButton *)sender { if (playBool == YES) { NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&error]; [player setNumberOfLoops:0]; [player play]; } else if (playBool == NO) { if ([recorder isRecording]) { [recorder stop];

iPhone - AVAudioRecorder - how can I record to an mp3?

江枫思渺然 提交于 2019-11-29 16:15:02
问题 I am using the AVAudioRecorder class available with the 3.0 SDK to record audio in my app. I am successfully able to record to a caf/aiff file. But I would like to record to an mp3. I tried changing some values in the settings dictionary but all I get is a blank file. Is it possible to record to an mp3 using AVAudioRecorder If not, how can I transfer the caf files from my app to a computer? Thanks. 回答1: From all I can find on the API documentation, you can't change the encoder. The only

Record all sounds generated by my app in a audio file (not from mic)

六眼飞鱼酱① 提交于 2019-11-29 13:43:10
问题 I have a screen that is like an instrument. There are buttons that play sound files. I want to record the sounds played as user presses the buttons in a single audio file so that i can save that file as mp4 or other audio format. Can you please guide me how to achieve this in a simple way? I am able to record using the mic with AVAudioRecorder As I think, the recording method uses the mic as a source, but I would like it to use the "audio out" equivalent of my app to use as a source. 回答1: You

AVAudioSession Swift

蹲街弑〆低调 提交于 2019-11-29 10:10:37
I am trying to write a swift iOS app that will record the users voice. I have wrote the following code in swift however it fails to request mic permissions from the user. It prints granted yet it never records audio and in the settings pane under privacy it does not list the app. How do I request recording permissions in swift? var session: AVAudioSession = AVAudioSession.sharedInstance() session.requestRecordPermission({(granted: Bool)-> Void in if granted { println(" granted") session.setCategory(AVAudioSessionCategoryPlayAndRecord, error: nil) session.setActive(true, error: nil) self