avaudiorecorder

How to record and play sound in iPhone app?

眉间皱痕 提交于 2019-12-17 10:34:24
问题 I tried using AVAudioSession and AVAudioPlayer to record and play sounds respectively but the sound volume is very low. I tried putting volume value of AVAudioPlayer to 1.0 and more but didnt help much. What could be my other options to record sound which can be loud enough to play back? 回答1: This code should be useful for you: #import <AudioToolbox/AudioServices.h> UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty (kAudioSessionProperty

iphone-peakPowerForChannel function in AVAudioRecorder doesn't work

谁说我不能喝 提交于 2019-12-13 20:17:41
问题 I am trying to use an AVAudioRecorder instance to record sound, the whole recording progress runs well, except that when I call [recorder peakPowerForChannel:0] trying to get the volume, the return value is always 0, that's pretty odd.. I have checked the recorded audio file, it's totally fine. Then I use AVAudioPlayer to play it, and during playing, i call [player peakPowerForChannel:0], the return value seems to be right and make sense. How can I get the right value ? I have set that:

How to detect a blow in the microphone with Unity and IOS

梦想的初衷 提交于 2019-12-13 11:51:26
问题 I'm aware that there are several threads with the same problem, but i haven't been able to make their solution work. I ended up creating this class: MicroController.h #import Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #import <CoreAudio/CoreAudioTypes.h> #import <UIKit/UIKit.h> @interface MicroController : UIView < UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, AVAudioSessionDelegate > { AVAudioRecorder *recorder; NSTimer *levelTimer;

tracksWithMediaType returns 0 tracks sometimes

*爱你&永不变心* 提交于 2019-12-12 17:04:56
问题 In my app I combine several .m4a audio files. For combining audio files I use below code. CMTime nextClipStartTime = kCMTimeZero; AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; for(NSString * str in filesNamesArray) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES)

After record sound file, this can't heard in iPad Air only

前提是你 提交于 2019-12-12 06:00:41
问题 I have an app in the Apple Store with voice recording capability. I migrate to Xcode 5.0.2 and SDK 7. I have no problem with this feature in devices with iOS 6 or 7 except with iPad Air. This is my record Sound routine: +(void) startRecording:(NSString *)fileName :(NSString *)fileType { NSError* theError = nil; BOOL result = YES; // Init audio with record capability AVAudioSession *audioSession = [AVAudioSession sharedInstance]; result = [audioSession setCategory:AVAudioSessionCategoryRecord

Play Audio File during an outgoing/incoming call in IOS

不打扰是莪最后的温柔 提交于 2019-12-12 05:37:11
问题 I am thinking of developing an application which will act like an IVR so when the user calls a number and does not want to talk instead he/she wants the called up number to listen to a pre-recorded sound. A sound will be played and called number will hear that. I have tried searching for any thread which could have discussion about this however did not find anything. I know how to record a sound but I don't know the procedure to play the same in a phone call. One work-around I can get that to

How to create a flashing record button for iPhone

假装没事ソ 提交于 2019-12-12 05:24:37
问题 I've looked at several posts, including [this one].1 This is exactly what I want to do, but I cannot get it to work. I want to show the user that they have pressed a record button, and that they will need to press it again to stop recording. So far, the code for the start recording method looks like this: NSLog(@"DetailVC - recordAudio - soundFilePath is %@", soundFile); [audioRecorder prepareToRecord]; recording = YES; NSLog(@"start recording"); NSLog(@"1"); //[autoCog startAnimating];

iphone sdk: initialization of a AVAudioRecorder returns nil

ぐ巨炮叔叔 提交于 2019-12-12 04:45:02
问题 I want to initialize a AVAudioRecorder with the aac Format. To do so, I use the following code: soundFilePath = [soundFilePath stringByAppendingPathExtension:@"aac"];NSURL *url = [NSURL fileURLWithPath:soundFilePath isDirectory:FALSE]; NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue:[NSNumber numberWithInt: 'aac '] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVEncoderAudioQualityKey]; /

AVAudioPlayer won't play existing file a second time

寵の児 提交于 2019-12-12 03:06:36
问题 I have searched a lot trying to figure this out - the code to me seems ok but the functionality doesn't reflect this. I have a View that is presented (its an Audio Recorder view). You can press record and it records to a file just fine (data exists in the file). I can then play the file back via the play button (the AVAudioPlayer is pointing to that file). However when I close/dismiss that view and come back to it - the file will not play when Play is tapped even though it should be exactly

AVAudioRecorder Losing Last Seconds

混江龙づ霸主 提交于 2019-12-11 23:35:40
问题 I'm using AVAudioRecorder to record an audio file of varying length with the following configuration: - (AVAudioRecorder*)recorder { if(!_recorder) { // Set the audio file NSArray *pathComponents = [NSArray arrayWithObjects:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"ExamTranscript.m4a", nil]; self.soundFileURL = [NSURL fileURLWithPathComponents:pathComponents]; // Define the recorder setting NSMutableDictionary *recordSetting = [