title: ios stream mp3 and record sound
body: <p>problem: cannot record sound after streaming audio over http.</p>
  
  <p>The problem which I am having is that I can no longer record sound after streaming mp3 using this guide: <a href="http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html" rel="nofollow">http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html</a></p>
  
  <p>I can record sound perfectly fine before i stream any mp3.  only after i stream mp3 using the guide that my ios app can no longer record sound.</p>
  
  <p>I was wondering if any of you might have run into this issue before or have any hunch of why this problem occur?  I'll go ahead and post my code for recording, just in case any of you would need to look at it.</p>
  
  <p>before i stream any mp3, audioRecorderDidFinishRecording always fire after a record has been done.</p>
  
  <p>after i stream mp3, audioRecorderDidFinishRecording never fire after a record has been done.</p>
  
  <p>Thank you in advance for your help.</p>
  
  <pre><code>    // #########################
      NSURL *soundFileUrl = [NSURL fileURLWithPath:self.recordFilePath];
  
      NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                                [NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey,
                                [NSNumber numberWithInt:AVAudioQualityMax], AVEncoderAudioQualityKey,
                                [NSNumber numberWithInt:24], AVEncoderBitRateKey,
                                [NSNumber numberWithInt:1], AVNumberOfChannelsKey,
                                [NSNumber numberWithFloat:22050.0f], AVSampleRateKey,
                                nil];
  
       NSError *error = nil;
       self.recorder = [[AVAudioRecorder alloc] initWithURL:soundFileUrl settings:recordSettings error:&amp;error];
  
       if (error)  {
         NSLog(@"%@", error);
       } else{    
         self.recorder.delegate = self;
         [self.recorder  prepareToRecord];    
         [self.recorder record];
  
         self.recordCountdown = [NSTimer scheduledTimerWithTimeInterval:(1.0/1.0) target:self selector:@selector(updateLabelCountdown) userInfo:nil repeats:YES]; 
       }
  
      // delegate for finish recording with success and failure
      - (void) audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag {  
          NSLog(@"record did finish flag - %d", flag);
        }
  
      - (void) audioRecorderEncodeErrorDidOccur:(AVAudioRecorder *)recorder error:(NSError *)error   {
          NSLog(@"error record - %@", [error localizedDescription]);
        }
  </code></pre>