2

I am Accessing ipod library in iphone application and showing title, lyrics and artwork of album.. I also want to show lyrics of songs. I have added lyrics in itunes and sync it with device.But my code is not showing lyrics ..

Example from here and code to get lyrics is :-

- (void)handleNowPlayingItemChanged:(id)notification {
    // Ask the music player for the current song.
    MPMediaItem *currentItem = self.musicPlayer.nowPlayingItem;

    // Display the artist, album, and song name for the now-playing media item.
    // These are all UILabels.
    self.songLabel.text   = [currentItem valueForProperty:MPMediaItemPropertyTitle];
    self.artistLabel.text = [currentItem valueForProperty:MPMediaItemPropertyAlbumArtist];
    self.albumLabel.text  = [[currentItem valueForProperty:MPMediaItemPropertyLyrics]retain];    


}

Please Help. Thanks

iProgrammer
  • 3,099
  • 3
  • 33
  • 59
  • 2
    possible duplicate of [iPhone song lyrics access](http://stackoverflow.com/questions/6357436/iphone-song-lyrics-access) – Brad Larson Dec 12 '11 at 21:47

1 Answers1

0
NSURL* songURL = [mediaItem valueForProperty:MPMediaItemPropertyAssetURL] 
AVAsset* songAsset = [AVURLAsset URLAssetWithURL:songURL options:nil]; 
NSString* lyrics = [songAsset lyrics];
McDowell
  • 107,573
  • 31
  • 204
  • 267
v_1
  • 469
  • 7
  • 18