I had imported an .mp3 file form MPMediaPickerController by below code:-
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAny];
mediaPicker.delegate = self;
mediaPicker.allowsPickingMultipleItems = YES;
mediaPicker.prompt = @"Select songs to play";
[self presentModalViewController:mediaPicker animated:YES];
[mediaPicker release];
Now i want to Convert the selected .mp3 file into NSDATA so that i can upload that nsdata into the server :-
- (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection
{
MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
[musicPlayer setQueueWithItemCollection: mediaItemCollection];
NSLog(@"==>%@",musicPlayer);
[musicPlayer play];
[self dismissModalViewControllerAnimated: YES];
}
The main problem in how do i convert musicfile into the NSDATA or into anyother format through which i can upload it into the server.Can then can easily use that after downloading the same file as audio file