Pergunta

I'd like to use an MPMediaPickerController to allow a user to select a song from his/her iPod library. From there he/she should be able to select a clip (~15s) of the song by specifying a start time and end time. Finally, the user should be able to send that clip to a friend or post it to a social network. For this, I think I'll need to create a new audio file from the raw iPod audio data.

My approach so far is to select the song, then get an AssetURL in the callback like so:

- (void) mediaPicker: (MPMediaPickerController *) mediaPicker
  didPickMediaItems: (MPMediaItemCollection *) collection {
    MPMediaItem *item = [[collection items] objectAtIndex:0];
    NSURL *url = [item valueForProperty:MPMediaItemPropertyAssetURL];
}

Then I can process the audio using (pseudocode):

ExtAudioFileCreateWithURL:url

The problem is that some songs have a null URL. Is this do to some sort of DRM restriction, and if so is there a workaround? Is this the best approach for the desired task?

Foi útil?

Solução

Turned out it was a DRM restriction.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top