Getting list/path of songs from iphone's library - objective-c

Want to create an alarm application, that will play a music file at a specific time. How can i get list of songs from iphone's library. I want to show this list in tableview, user can then select a single file that will be played at sepecified time.
Any code sample?

Just use the MPMediaPickerController.
The sample code AddMusic shows how to choose (and add) music in the iPod library.

Related

How to pass the MediaLibrary to the AudioService and start playing from specific song in flutter

I have all the UI and logic to read songs from the device and I made my own loagic for playlists because android 10 has a bug. Anyways, so I'm looking on the audio_service package. The example has it all, but the Media library is hardcoded. Despite the name I can imagine this as Playlist with a list of songs.
How can I pass the playlist chosen to play. Maybe Shared preferences?
And another question: Is there a way from which song to start playing the playlist?

How to play sound from resources using windows media player?

I am making a game, so at one point I need to play two sounds at once, so I played the first one using the "My.Computer.Audio.Play()" Method to load from resources.
As for the second, I used Windows Media Player to load the second sound In A SPECIFIC FOLDER, now I know it is possible to extract files to a folder and program it to play from there to avoid trouble, but I don't want them to be extracted.
So I'm trying to get the file path from resources and put it in WMP's URL, but couldn't get any result after searching the internet.
Am I missing something?
And if you know any better alternative, make sure it can:
1- Replay sound (coding with timer is ok),
2- Change Sound Position
You can use the MediaPlayer class in code or MediaElement in XAML for playing audio files in a WPF application. Check out the article WPF Media Player In VB.NET for code samples.

Using Audio Unit (Mixer Host) to play from iPod library instead of pre selected sound files.

For a university project i'm working on a DJ mixing app. I'm essentially tackling this project from a 'teach yourself from scratch by googling everything and analysing pre existing source code' type of way so go easy.
I have looked at the Mixer Host sample project from apple found here: http://developer.apple.com/library/ios/#samplecode/MixerHost/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010210
I can't work out how to replace the pre selected audio files (guitar + beat) with a song URL from the iPod library selected from a media picker, or, in this case - 2 media pickers.
Is it a case of grabbing the URL of the iPod library song selected and putting in place of the URL of the preselected audio file?
If someone could point me in the right direction, tell me how i'm completely going about this the wrong way, or even do the coding for me (joke), it would be greatly appreciated.
You can't actually simply stream from the ipod library; you need to copy the files into the documents directory of the app.
try this: http://www.subfurther.com/blog/2010/12/13/from-ipod-library-to-pcm-samples-in-far-fewer-steps-than-were-previously-necessary/
You can use third party libraries to play a iPod library songs using AudioUnit. The below link is useful to you
Clickhere!

Star a song in spotify from an external source?

I'm looking for a way to star a song in Spotify without having to go to the app itself.
For instance:
I'm playing a game on fullscreen, or I'm working on something and Spotify is on for music. I hear a great song and I want to star it.
Now instead of going to the app, I want to star the song using a shortcut or a dedicated external button.
Whether it is a shortcut, a USB button, or a button on a remote, I believe this function would be really helpful. I've searched through the Spotify core API, but I couldn't find anything that enables me to "star" a song.
Any ideas?
Since you tagged CocoaLibSpotify in this question, well, CocoaLibSpotify has this functionality built right in - the SPTrack object has the starred property. It'd be fairly simple to write a little app that, when triggered, fetches the currently playing track using the Spotify client's AppleScript bridge and use CocoaLibSpotify to star it.
Alternatively, the Apps API can star a track as well (the Track object has the starred property). You could use the player object to get the current track and star it. However, linking that to an external button will be tricky. One (hacky) way would be to have the button trigger a system URL launch of spotify:app:star-this-track:invocation:1 where the number at the end increments each time you push the button. Then, the application's ARGUMENTSCHANGED event will fire, at which point you can star the track.

Which one is the folder containing iPhone/iPad images

I'm developing an application and I'd like to list the images present in the "Documents" directory of my application (to load images using iTunes) and I'd like to list the images and photos taken by the Camera as well.
And I do know about UIImagePickerController, but I don't need that. I want to integrate the photos and the loaded application images in the same place. But I can't find any information about where can I find all the device camera photos.
Thanks in advance
You can access all the photos stored in the photo library using the Assets Library Framework. Check out the documentation here:
https://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/AssetsLibraryFramework/_index.html
Specifically, you want to use ALAssetsLibrary's enumerateGroupsWithTypes:usingBlock:failureBlock: to enumerate the ALAssetsGroupSavedPhotos type, and enumerate the photos in that group with ALAssetGroup's enumerateAssetsUsingBlock:.
Some links with sample code:
http://www.icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/
http://www.fiveminutes.eu/accessing-photo-library-using-assets-library-framework-on-iphone/