0

I want to create the background audio _playlist from a local database table (LINQ). Here's the code in AudioPlayer.cs in the PlaybackAudio project:

    private static List<AudioTrack> _playList = new List<AudioTrack>
    {
         new AudioTrack(
            new Uri("Ring01.mp3", UriKind.Relative), 
            "Some song",   // can be an empty string if no song title
            "Some artist", // can be an empty string if no artist name
            null, // album
            null // album art
            )
    };

and i want to tansform it in:

    private static List<AudioTrack> _playList = from SongsItem song in songsDB.Items
                            select new AudioTrack(
            new Uri(SongsItem.url, UriKind.Relative), 
            "SongsItem.title",   // can be an empty string if no song title
            "SongsItem.artist", // can be an empty string if no artist name
            null, // album
            null // album art
            );

For that I need to connect the playback audio to a local database. If it isn't possible, can I create the playlist from the main project?

1 Answers1

0

I don't know a LINQ solution for your problem. However you can definitely create the playlist from your main project. The main concept is that you will need to save your songs in a file (.dat for example) in Isolated Storage. Then you will retreive the music of your playlist from Isolated Storage. To this direction the following sample from Nokia website will help you. Have a look :

Saving and Retreiving from Isolated Storage Example

Byron Gavras
  • 970
  • 10
  • 16