开发者

How to Get lyrics of song from ipod library songs

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.artistLab开发者_Python百科el.text = [currentItem valueForProperty:MPMediaItemPropertyAlbumArtist];
    self.albumLabel.text  = [[currentItem valueForProperty:MPMediaItemPropertyLyrics]retain];    


}

Please Help. Thanks


NSURL* songURL = [mediaItem valueForProperty:MPMediaItemPropertyAssetURL] 
AVAsset* songAsset = [AVURLAsset URLAssetWithURL:songURL options:nil]; 
NSString* lyrics = [songAsset lyrics];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜