title: How to play wav file from directory path
body: <p>I am trying to play wav file from my directory path which I saved in there before, but I can't play, I hope someone can help me</p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *directoryPath = [paths objectAtIndex:0];
  directoryPath =[NSString stringWithFormat:@"%@/%@",directoryPath,@"path1.wav",nil];
  audioPath1 = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:directoryPath] error:NULL]; 
  [audioPath1 play];
  </code></pre>