title: Getting NSData out of music file in iPhone
body: <p>I have retrieved all musics and videos from my iPhone device. I am now stuck in saving those in to my application, i am unable to get the raw data out of the file. Can any one help me to find a solution for this. this is the code i used to get the music files. </p>
  
  <pre><code>MPMediaQuery *deviceiPod = [[MPMediaQuery alloc] init];
  NSArray *itemsFromGenericQuery = [deviceiPod items];
  for (MPMediaItem *media in itemsFromGenericQuery){
   //i get the media item here.
  }
  </code></pre>
  
  <p>How to convert it to NSData ??
  This is what i tried to get the data</p>
  
  <pre><code>audioURL = [media valueForProperty:MPMediaItemPropertyAssetURL];//here i get the asset url
  NSData *soundData = [NSData dataWithContentsOfURL:audioURL];
  </code></pre>
  
  <p>using this was useless for me. i dint get the data from the <code>LocalAssestURL</code>. Any solution for this. Thanks in advance</p>