views:

19

answers:

0

with below code i can record sound but this way record any sound that play around device i just want to record sound that play with AVAudioPlayer in my app.is it possible ?

NSError *err = nil;
 AVAudioSession *audioSession = [AVAudioSession sharedInstance];
 [audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];
 [audioSession setActive:YES error:&err];

 recordSetting = [[NSMutableDictionary alloc] init];
 [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
 [recordSetting setValue:[NSNumber numberWithFloat:44100.0f] forKey:AVSampleRateKey];
 [recordSetting setValue:[NSNumber numberWithInt:1 /* mono */ ] forKey:AVNumberOfChannelsKey];
 [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
 [recordSetting setValue:[NSNumber numberWithBool:NX_BigEndian == NXHostByteOrder()] forKey:AVLinearPCMIsBigEndianKey];
 [recordSetting setValue:[NSNumber numberWithBool:0] forKey:AVLinearPCMIsFloatKey];
...