2

How can I write an audio file picked from mediaPicker into some particular folder? We are currently writing image to file path with this method:

[UIImagePNGRepresentation(image) writeToFile:pngPath atomically:YES];

Is it possible for to do the same kind of thing with an audio file?

Thanks.

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
ios
  • 6,134
  • 20
  • 71
  • 103
  • hey you can try this tutorial:-http://www.subfurther.com/blog/2010/07/19/from-iphone-media-library-to-pcm-samples-in-dozens-of-confounding-potentially-lossy-steps/ – Leena Jul 25 '12 at 06:57

1 Answers1

0
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag

is a method of the NSData class, so, once you have fetched your audio from the media picker, you should totally be able to write it to a file that way.


Note: You might have to convert the audio picked to NSData first

Cheers

Fran Sevillano
  • 8,103
  • 4
  • 31
  • 45