title: iphone: how to buffer and play audio?
body: <p>I need to implement the code for my app to buffer and play my audio file which is I am streaming.</p>
  
  <p>I got one of the option <code>AudioQueue</code> but didn't find much code to understand the things to implement.</p>
  
  <p>I have tried with Simply creating streamer and destroying streamer.</p>
  
  <pre><code>-(void)destroyStreamer
  {
      if(streamer)
          [streamer stop];
  }
  
  -(void)createStreamer
  {
      if(streamer)
          return;
      [self destroyStreamer];
  
      NSString *escapedValue = (__bridge_transfer NSString * )CFURLCreateStringByAddingPercentEscapes(nil, (__bridge CFStringRef)txtField.text, NULL, NULL, kCFStringEncodingUTF8);
  
      NSURL *url = [NSURL URLWithString:escapedValue];
  
      streamer = [[AudioStreamer alloc] initWithURL:url];
  
  
  }
  </code></pre>