Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get data or songs of music player in iPhone app?

Hello first of all I am new in iPhone,

I want access all songs in my application. Is this posible to get all songs ?

Thank you very much. May be it's easy for you but for me it's hard.

like image 332
Palsofiphone Avatar asked Feb 17 '12 14:02

Palsofiphone


People also ask

Where are music files stored on an iPhone?

In the Music app, tap Library, then tap a category, such as Albums or Songs; tap Downloaded to view only music stored on iPhone. Scroll to browse or swipe down the page and type in the search field to filter your results and find what you're looking for.

Does the Music app on iPhone use data?

Since cellular bandwidth is often limited, you may be interested in preserving your cellular data and using Low Data Mode for Apple Music. Apple Music's streaming quality tops out at 256 kbps, which means that at the high-quality setting, you'd approximately consume a little above 5 MB of data for a three-minute song.

How do I find out what music is playing on my iPhone?

Identify songs in Control Center on iPhone or iPad To identify songs, open Control Center, then tap the Shazam button . Shazam can identify songs playing on your device even when you're using headphones. To find songs you've identified, touch and hold the Shazam button in Control Center to open your History View.

Can iPhone download offline songs?

Download a song, album, or playlist: Touch and hold music you've added to your library, then tap Download. at the top of the screen. Note: You must turn on Sync Library to download music from Apple Music to your library (go to Settings > Music, then turn on Sync Library).


2 Answers

You need the Media Player framework:

  • MPMediaLibrary, MPMediaQuery, etc.
  • iPod Library Access Programming Guide

Actual example taken from the docs:

MPMediaQuery *everything = [[MPMediaQuery alloc] init];

NSLog(@"Logging items from a generic query...");
NSArray *itemsFromGenericQuery = [everything items];
for (MPMediaItem *song in itemsFromGenericQuery) {
    NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
    NSLog (@"%@", songTitle);
}
like image 97
djromero Avatar answered Sep 19 '22 14:09

djromero


This tutorial might help you as well.

like image 44
Ayrad Avatar answered Sep 18 '22 14:09

Ayrad